help_for_excel
Board Regular
- Joined
- Feb 24, 2012
- Messages
- 72
my code is in a below line(runs perfect):
Set rngItems = Sheets("Sheet1").Range("Name_List")
Problem is, I don't want to go into VBA and change every time, rather I want to do it from Excel window only. I wrote this code but it is giving me error.
sheet_loc is a single cell range in excel, where one can put sheet1 or sheet2 etc. and Name_List is range of excel cells on that particular sheet. So basically VBA refers to particular range and that range refers to another range.
Set rngItems = Sheets(Range("sheet_loc")).Range("Name_List")
please tell me how to fix this code....thanks in advance
Set rngItems = Sheets("Sheet1").Range("Name_List")
Problem is, I don't want to go into VBA and change every time, rather I want to do it from Excel window only. I wrote this code but it is giving me error.
sheet_loc is a single cell range in excel, where one can put sheet1 or sheet2 etc. and Name_List is range of excel cells on that particular sheet. So basically VBA refers to particular range and that range refers to another range.
Set rngItems = Sheets(Range("sheet_loc")).Range("Name_List")
please tell me how to fix this code....thanks in advance
Last edited: