Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Mulipule Columns & VBA
I have a series of columns I wish to hide, these change depending on the
report selected VBA refers to F18 on sheets1 and changes dependent on the report selected code is; Sheets(2).Select Columns("V:AB").Select ' Resets all columns Selection.EntireColumn.Hidden = False colhide = sheets(1).range("F18") Sheets(2).Select Columns(colhide).Select Selection.EntireColumn.Hidden = True This works if the Columns are a continious block ie. F18 = "B;F" but fails if F18="B:B,F:AA,AC:AC" Any ideas |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Mulipule Columns & VBA
Hi,
Try this in F18 V:V,W:W,X:X,Y:Y,Z:Z,AA:AA,AB:AB, AF:AF and you may find this a little better Sub ordinate() colhide = Sheets(1).Range("F18") Sheets(2).Select Range(colhide).EntireColumn.Hidden = True End Sub Mike "Excel 2007 - SPB" wrote: I have a series of columns I wish to hide, these change depending on the report selected VBA refers to F18 on sheets1 and changes dependent on the report selected code is; Sheets(2).Select Columns("V:AB").Select ' Resets all columns Selection.EntireColumn.Hidden = False colhide = sheets(1).range("F18") Sheets(2).Select Columns(colhide).Select Selection.EntireColumn.Hidden = True This works if the Columns are a continious block ie. F18 = "B;F" but fails if F18="B:B,F:AA,AC:AC" Any ideas |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Mulipule Columns & VBA
Works Great
Thanks I knew it would be simple "Mike H" wrote: Hi, Try this in F18 V:V,W:W,X:X,Y:Y,Z:Z,AA:AA,AB:AB, AF:AF and you may find this a little better Sub ordinate() colhide = Sheets(1).Range("F18") Sheets(2).Select Range(colhide).EntireColumn.Hidden = True End Sub Mike "Excel 2007 - SPB" wrote: I have a series of columns I wish to hide, these change depending on the report selected VBA refers to F18 on sheets1 and changes dependent on the report selected code is; Sheets(2).Select Columns("V:AB").Select ' Resets all columns Selection.EntireColumn.Hidden = False colhide = sheets(1).range("F18") Sheets(2).Select Columns(colhide).Select Selection.EntireColumn.Hidden = True This works if the Columns are a continious block ie. F18 = "B;F" but fails if F18="B:B,F:AA,AC:AC" Any ideas |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
to convert columns to rows having mulit independent group columns | Excel Worksheet Functions | |||
Combine multiple columns into two long columns, Repeating rows in first column | Excel Discussion (Misc queries) | |||
Combine multiple columns into two long columns, Repeating rows in first column | Excel Discussion (Misc queries) | |||
Pivot Table Creating New Columns that Subtract Two Existing Columns | Excel Discussion (Misc queries) | |||
Why text to columns is not available when there is mulipule line . | Excel Worksheet Functions |