Excel VBA Hiding a Column - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Excel VBA Hiding a Column

rrfullirrfulli Posts: 1Member
I am looking for a method to hide a selected column using VBA in excel. To select a column I:

Worksheets("Sheet1").Columns(1).Select

That's as far as I get. The column is now selected. How do I hide the selected column??????

Thanks
Ranny

Comments

  • markycmarkyc Posts: 11Member
    Hey Ranny,

    With any kind of simple task you can use the macro recorder in order to automatically generate the code for you:
    ie:

    Columns("I:I").Select
    Selection.EntireColumn.Hidden = True

    In general you just set the EntireColumn.Hidden property to True or False to hide/unhide a particular column.
    Columns("I:I").EntireColumn.Hidden = True

    Ciao,
    Mark


    : I am looking for a method to hide a selected column using VBA in excel. To select a column I:
    :
    : Worksheets("Sheet1").Columns(1).Select
    :
    : That's as far as I get. The column is now selected. How do I hide the selected column??????
    :
    : Thanks
    : Ranny
    :

Sign In or Register to comment.