I have been trying to use CountIf to retrieve data from a work sheet other than the one that provides the search criteria for the countif function. This works
However Cannot figure out what I need to replace the source range "A3:A1300" with. I use a function to call the Last row (LRow) on the worksheet "WorkS", but when I try this
I get a run time error 1004. Any suggestions greatly appreciated
Thanks
Peter
Code:
Cells(x, 3) = Application.WorksheetFunction.CountIf((Worksheets(WorkS).Range("A3:A1300")), ActiveCell.Offset(0, -1).Value)
However Cannot figure out what I need to replace the source range "A3:A1300" with. I use a function to call the Last row (LRow) on the worksheet "WorkS", but when I try this
Code:
Cells(x, 3) = Application.WorksheetFunction.CountIf(((Worksheets(WorkS).Range(Cells(3, 1), Cells(LRow, 1)))), ActiveCell.Offset(0, -1).Value)
I get a run time error 1004. Any suggestions greatly appreciated
Thanks
Peter