Hi,
Quote:
Originally Posted by mikezx10
its in sheet1 i guess i should move to mod
|
Yes exactly. You have not qualified the parent worksheet of the range which means it will belong to the worksheet that corresponds to that sheet class module. You can only select a range on the active sheet so unless that sheet happens to be the active sheet you will get an error. Either specify the parent sheet or move the code into a standard module to correct this.
Of course, the other point to be made is that it is very uncommon to actually need to select a range with vba code... the range object can be worked with directly rather than working with the selection object. Doing it that way avoids issues such as the one you are seeing here and makes code run more quickly.