I am using the following code to determine the next empty row on a worksheet:
emptyrow = WorksheetFunction.CountA(Range("B:B")) + 1
However, I have noticed that it only works when the page I want to use is activated. I have tried using with statements as so:
With MyWorksheet
emptyrow = WorksheetFunction.CountA(Range("B:B")) + 1
End With
But realized almost as soon as I had finished typing it that that isn't the correct usage of with. How can I perform worksheetfunctions without activating the worksheet? I am looping through many worksheets and don't want each to activate. Thanks!