I am trying to run a "DCOUNT" formula in a cell in VBA but then my database range (in the formula) refers to a dynamic range on a different sheet. Now the challenge is:
how do I frame my VBA code to refer to the database (which would be dynamic but always starting from cell A1 with the same number of columns but the number of rows would change depending on the data copied in) in a sheet different from the sheet where the result of the formula is to appear?
Private Sub DeriveTheFigures_Click()
Worksheets("see the figures.").Activate
Dim fulldataset As Range
Worksheets("paste trial billing here.").Range("a1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select fulldataset= Selection.Address(rowabsolute:=False, columnabsolute:=False)
Range("f9").FormulaR1C1 = "=DCOUNT("
End Sub**