REX BONNETTE
New Member
- Joined
- Mar 18, 2009
- Messages
- 2
On windows xp proffesional , with excell 2007 I am trying to create a macro to hide the next visible column and unhide the 10 th unvisible column . I tried this .
Sub SelectNextVisiblkeCell2()
Dim rg As Range
Set rg As Range
Set rg = Range("a:a")
Set rg = rg.SpecialCells(xlCellTypeVisible)
rg.Select
i = 1
For Each cell In Selection
If i = 2 Then
cell.Select
Exit sub
End if
i = i + 1
Next cell
ActiveCell.EntireColumn.Select
Selection.EntireColumn.Hidden = True
End Sub

Sub SelectNextVisiblkeCell2()
Dim rg As Range
Set rg As Range
Set rg = Range("a:a")
Set rg = rg.SpecialCells(xlCellTypeVisible)
rg.Select
i = 1
For Each cell In Selection
If i = 2 Then
cell.Select
Exit sub
End if
i = i + 1
Next cell
ActiveCell.EntireColumn.Select
Selection.EntireColumn.Hidden = True
End Sub