I think there is a limit on the length of a variable? I'm hitting a road bump in a macro where a user chooses a list of worksheets from a userform and then the macro will clear the named ranges on that sheet. And some of the named ranges are grabbing multiple cells and ranges on the sheet, thus getting quite long.
With some past help here in the forums, this is the script within the userform that will clear all of the range areas for each sheet selected. But i'm finding it fails when the named range gets over 255 characters long.
example of named range.
And this part of the script doing the clear.Please Login or Register to view this content.
Also, separately, I'm wondering if this could be done better where I don't have to loop all of the named ranges for each sheet selected? Can it be reversed to loop the named ranges once and compare them to the Sheet Name and if matched perform the clear? would that be better? There is a likely chance a user will selected multiple worksheets to clear, and there over a 100 named ranges already in workbook.Please Login or Register to view this content.
Bookmarks