tourgis2000
New Member
- Joined
- Sep 3, 2008
- Messages
- 48
Hi,
Once again I again I find myself fumbling with basic VBA. I need to hide or unhide a number of columns on each worksheet of a file but the number of columns is different on each worksheet. I have a clculation in my spreadsheet as follows:
="B:"&SUBSTITUTE(ADDRESS(10,A1+1,4),"10","")
This might produce the following:
B:F
How can I get this into VBA thus?
Thanks,
Martin
Once again I again I find myself fumbling with basic VBA. I need to hide or unhide a number of columns on each worksheet of a file but the number of columns is different on each worksheet. I have a clculation in my spreadsheet as follows:
="B:"&SUBSTITUTE(ADDRESS(10,A1+1,4),"10","")
This might produce the following:
B:F
How can I get this into VBA thus?
Code:
Sub Hide_columns()
Columns("B:F").Select
Selection.EntireColumn.Hidden = True
Range("A1").Select
End Sub
Martin