Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How can I select multiple columns in Excel using VBA when
the number of columns is a variable? I have a variable that tells me how many columns to select. How can I make VB select the number of columns (for hiding) based on the variable that I have? Jay |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this Jay
Sub test() Dim var As Integer var = 3 Columns(ActiveCell.Column).Resize(, var).Hidden = True End Sub -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2) www.rondebruin.nl "Jay" wrote in message ... How can I select multiple columns in Excel using VBA when the number of columns is a variable? I have a variable that tells me how many columns to select. How can I make VB select the number of columns (for hiding) based on the variable that I have? Jay |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Selecting nonadjacent columns? | Excel Worksheet Functions | |||
Selecting different multiple columns | Excel Worksheet Functions | |||
Selecting Multiple Columns in a Named Selection | Excel Worksheet Functions | |||
Selecting multiple columns for subtotals | Excel Discussion (Misc queries) | |||
selecting columns in a worksheet | Excel Worksheet Functions |