Robert E Lee
Active Member
- Joined
- Aug 10, 2005
- Messages
- 266
Hi All
I am attempting to loop through each sheet in a workbook, find the first blank after "A2" and therefrom create a range.
The problem seems to be that whatever sheet the macro is assessing it always finds the value for the first blank on Sheet1
I suspect that i need to change "After:=ActiveCell" to "After:rs.Range("A2")" ( which does not compile.).
Any guidance much appreciated
Rob
I am attempting to loop through each sheet in a workbook, find the first blank after "A2" and therefrom create a range.
The problem seems to be that whatever sheet the macro is assessing it always finds the value for the first blank on Sheet1
Code:
For Each rs In Wb.Sheets
If rs.Name <> "sheet1" Then
i = Cells.Find(what:="", After:=ActiveCell, searchorder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Row
I suspect that i need to change "After:=ActiveCell" to "After:rs.Range("A2")" ( which does not compile.).
Any guidance much appreciated
Rob