Hiding visible columns

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
:confused:
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
You should continue your original thread.

Your code doesn't explain what you are trying to do.
 
Upvote 0

Forum statistics

Threads
1,203,066
Messages
6,053,330
Members
444,654
Latest member
Rich Cohen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top