Home Forums Chat Forum Excel VB Question

Viewing 4 posts - 1 through 4 (of 4 total)
  • Excel VB Question
  • footflaps
    Full Member

    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?

    damitamit
    Free Member

    try activesheet.Column(9).EntireColumn.select

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

    something along those lines i think…

    damitamit
    Free Member

    also, your line should be

    ActiveSheet.Columns(9).Select

    i.e Columns, not Column

    that should work too.

    footflaps
    Full Member

    ‘fraid not

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

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Excel VB Question’ is closed to new replies.