Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I got this code but it doesn't work.
Sub Tester01() Dim rng As Range, rng2 As Range, rng3 As Range Dim col As Range Application.ScreenUpdating = False On Error Resume Next Set rng = ActiveSheet.AutoFilter.Range rng.EntireColumn.Hidden = False If Not rng Is Nothing Then Set rng2 = rng.SpecialCells(xlCellTypeVisible) On Error GoTo 0 For Each col In rng2.Columns Set rng3 = Intersect(col.EntireColumn, rng2) col.EntireColumn.Hidden = Application.CountA(rng3) < 2 Next col End If Application.ScreenUpdating = True End Sub What am I doing wrong? Do I have to change the cellproperties from standard or number to text? Or am I totally looking in the wrong direction? let me know! rens |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
What is wrong with this code? | Excel Discussion (Misc queries) | |||
Can someone tell me what is wrong with this code? | Excel Discussion (Misc queries) | |||
What's wrong with this code? | Excel Programming | |||
What's wrong with this code??? | Excel Programming | |||
what's wrong with my code???? | Excel Programming |