Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
display columns
greetings, i have macro which runs query on database with over 100 columns.
when macro is finished i want to display only those columns i've run the query on, anywhere from two to twenty columns. therefore i hide all the columns of database and have a range which lists each column to display by number (col A =1, col B = 2, etc.) what type of code would i use to display the columns. have used "EntireColumn.Hidden = false" but only seems to work for single column at a time, which would work with a loop. but i'm hoping there's some code that would unhide all the columns at once, any help greatly appreicated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
display columns
Hi
For instance: Range("A1,C1,F1").EntireColumn.Hidden = True But a small loop is not so inefficient in this case. -- Wigi http://www.wimgielis.be = Excel/VBA, soccer and music "mwam423" wrote: greetings, i have macro which runs query on database with over 100 columns. when macro is finished i want to display only those columns i've run the query on, anywhere from two to twenty columns. therefore i hide all the columns of database and have a range which lists each column to display by number (col A =1, col B = 2, etc.) what type of code would i use to display the columns. have used "EntireColumn.Hidden = false" but only seems to work for single column at a time, which would work with a loop. but i'm hoping there's some code that would unhide all the columns at once, any help greatly appreicated. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
display columns
There are many ways to address ranges, but the following code may give you a
start. Dim R As Range With Worksheets("Sheet1") Set R = .Range("A1, C1, E1") R.EntireColumn.Hidden = True ' OR Set R = Application.Union( _ .Cells(1, 1), .Cells(1, 3), .Cells(1, 5)) R.EntireColumn.Hidden = True End With -- Cordially, Chip Pearson Microsoft Most Valuable Professional Excel Product Group Pearson Software Consulting, LLC www.cpearson.com (email on web site) "mwam423" wrote in message ... greetings, i have macro which runs query on database with over 100 columns. when macro is finished i want to display only those columns i've run the query on, anywhere from two to twenty columns. therefore i hide all the columns of database and have a range which lists each column to display by number (col A =1, col B = 2, etc.) what type of code would i use to display the columns. have used "EntireColumn.Hidden = false" but only seems to work for single column at a time, which would work with a loop. but i'm hoping there's some code that would unhide all the columns at once, any help greatly appreicated. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
display columns
hi wigi and chip, i was hoping there was a way i could use the column numbers
en masse. yes, am using a loop and that works fine as the query rarely needs to display more than twenty columns. appreciate the responses! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
display columns alphabetically | New Users to Excel | |||
Compare columns and display the value | Excel Discussion (Misc queries) | |||
display only columns A to I | Excel Programming | |||
Scrolling columns display | Excel Programming | |||
compare two columns and display a third | Excel Discussion (Misc queries) |