I wanted to perform a selection of some columns on a worksheet and then do some other things with that selection. The worksheet in question isn't active.
To select the columns, I did the following:
This worked well, but I didn't really want to make the sheet active if I could avoid it, so I tried this
It didn't work. I am sure that you object model gurus out there can see immediately what is wrong (or perhaps you have to have the sheet active in order to select columns). So, how to solve the problem. Grateful for any help.
Thanks
Bengt
To select the columns, I did the following:
Code:
Sheets("ACertainSheet").Activate
Columns("H:K").Select
This worked well, but I didn't really want to make the sheet active if I could avoid it, so I tried this
Code:
Sheets("ACertainSheet").Columns("H:K").Select
It didn't work. I am sure that you object model gurus out there can see immediately what is wrong (or perhaps you have to have the sheet active in order to select columns). So, how to solve the problem. Grateful for any help.
Thanks
Bengt