New to the forum, new to vba programming, and hoping to get some help.
I have a workbook with multiple worksheets. There is a local range on each worksheet with the same name (User_Data). I have code that limits users' editing to just the User_Data area. Since the User_Data range is local, I can use the same code on all worksheets and everything works fine. However, I now need to add more ranges to each worksheet. The ranges are not contiguous and vary in size, so I need to give them different names. In addition, each worksheet could have a different number of ranges. I decided to name the ranges User_Data1, User_Data2, etc. I want to keep the names the same so my code is universal across all sheets. I added some code to check if the user selection is contained inside one of the ranges (just like I did with the original) and tried to check all User_DataX ranges, keeping in mind that the number of ranges is variable by sheet. However, my code (some of which is borrowed) doesn't work and I am stuck (keep in mind I'm relatively new to vba, but reading like a madman!!). Below is my code. Also, I need to shrink my User_DataX range by one row on the top and one row on the bottom before I check to see if the selection is contained in that range. Thanks in advance for any suggestions.
Bookmarks