I’ve shortened my code a bit for the purposes of the question, but the error I’m getting is the same.
When trying to select the cells with data in column A on each worksheet and doing stuff with it, I get an error after the first worksheet:
Sub quickSub()
Dim sh As Worksheet
For Each sh In Worksheets
sh.Range("A6", Range("A6").End(xlDown)).Select
''Random bits of code here where I manipulate selection on each worksheet
Next
End Sub
The error I get is:
"Run-time error '1004': Method 'Range' of object'_Worksheet' failed.
Try this:
I made sure the range reference was end downing on the right sheet
And I had the end down return the final row number and concatenate with the column letter which may not be needed, but may make it easier for you to debug.
Update:
Added activate line. Selection may require the sheet be active.
Update2:
Here’s the ‘Right’ way to do this WITHOUT using select
Using this method directly referneces the worksheet data INSTEAD of needing to move around worksheet by worksheet.
This best practice will increase your code performance