G'day y'all,
I am trying to write some code which performs the following routines:- Remove any current Range Names
- On certain worksheets, set some range names for an unknown number of rows (ie. they will change every month)
My code is below. For some reason, the While . . . Wend routine will only use the last used row number for the worksheet "Week 1". The Do Until, while the With . . . End loop seems to change focus to each of the 5 worksheets, seems to always stop when y= the last row of the active worksheet. So, it seems the With Worksheets() isn't changing focus to each individual sheet and I end up with the correct range names, but only based on the number of active rows in the active sheet.
Other important points:- Excel 2010
- There should be no other Range Names used in the Workbook
- I want to use the Ranges in a summary sheet in SumIF() statements
Thank you,
Mitchies
Bookmarks