Excel VB Question
 

  You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more

[Closed] Excel VB Question

3 Posts
2 Users
0 Reactions
206 Views
Posts: 13594
Free Member
Topic starter
 

I've found a work around for what I want to do, but would like to understand why this doesn't work.

In a VB Macro Sub I have.

ActiveSheet.Column(9).Select

and it selects the entire worksheet rather than just Column 9?

If I record a macro and select just column 9 I get the above code, so why doesn't it work stand alone?


 
Posted : 12/01/2009 11:31 am
Posts: 54
Free Member
 

try activesheet.Column(9).EntireColumn.select

or activesheet.cells(9,1).entirecolumn.select

something along those lines i think...


 
Posted : 12/01/2009 11:32 am
Posts: 54
Free Member
 

also, your line should be

ActiveSheet.Columns(9).Select

i.e Columns, not Column

that should work too.


 
Posted : 12/01/2009 11:34 am
Posts: 13594
Free Member
Topic starter
 

'fraid not

Something more subtle is going on, even with the right syntax it selects the entire worksheet.


 
Posted : 12/01/2009 11:42 am

6 DAYS LEFT
We are currently at 95% of our target!