Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Loops with sheet codenames
I am trying to create a loop in code that does the same commands on multiple worksheets and I want to refer to each sheet using their codename so that it will still work if someone changes the worksheet name on the tab.
Something along these lines. for p = 2 to 6 name = "sheet" & p ARow = name.Cells(Rows.Count, "B").End(xlUp).Row etc next p I know that doesn't work so I need help with the code and how to dimension the variables. To clarify how I would like it to work it should end up doing ARow = sheet2.Cells(Rows.Count, "B").End(xlUp).Row when p = 2 Can this be done. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
loops???? | Excel Worksheet Functions | |||
Loops | Excel Discussion (Misc queries) | |||
Loops... | Excel Discussion (Misc queries) | |||
Use Sheet CodeNames to Select Sheet in Different Workbook | Excel Discussion (Misc queries) | |||
Using For - Next Loops in VB | New Users to Excel |