View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Excel 2007 - SPB Excel 2007 - SPB is offline
external usenet poster
 
Posts: 9
Default 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