I've recently converted a number of ranges to Named Ranges to try and 'protect' if the user adds any rows or columns to the sheet.
I have the below code basically 5 different times, for 5 separate spreadsheets.
I had thought that by also assigning named ranges to everything that I could then possible combine all the named ranges together into one singe macro. However, those attempts fail with a Method 'Range' of object '_Global' failed.
Essentially, I'm trying to learn if you can combine multiple Named Ranges from separate worksheets into 1 macro, or if you need to Select each sheet separately. Just trying to learn and improve. I thought about also trying to learn and create a 2 dimensional array of the sheet name and named ranges for each, and then loop it that way.
Or assign separate 'rows_rng' and 'col_rng' for each sheet?
The below works fine. Only trying to learn why adding names ranges from other sheets will fail (I did removed the Sheets.Select when trying to add additional named ranges from other sheets)
![]()
Please Login or Register to view this content.
Bookmarks