LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Columns hiding too soon!!!

I have the following system... I click the date in the top of the column (row
a) and it hides before I can get any data in it!!

I did previously have this working that it didnt hide the column until I
clicked in another cell. Any ideas?

Sub ABC()
Dim lastColumn As Long, rngA As Range, i As Long
Dim rng1 As Range
Application.ScreenUpdating = False
Columns.Hidden = False
lastColumn = Me.Cells(1, "IV").End(xlToLeft).Column
Set rngA = Me.AutoFilter.Range
Set rngA = rngA.Offset(1, 0) _
.Resize(rngA.Rows.Count - 1, 1)
For i = 4 To lastColumn
Set rng1 = Cells(3, i).Resize(rngA.Rows.Count, 1)
If Application.Subtotal(3, rng1) = 0 Then
Columns(i).Hidden = True
End If
Next
Application.ScreenUpdating = True
End Sub

Private Sub Worksheet_Calculate()
If Me.AutoFilterMode Then
ABC
Else
Columns.Hidden = False
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Me.AutoFilterMode Then
ABC
Else
Columns.Hidden = False
End If
End Sub


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding Columns SnareHiHat Excel Discussion (Misc queries) 2 October 16th 09 02:10 PM
Hiding columns davethewelder Excel Programming 3 March 20th 08 12:26 PM
Hiding Columns [email protected] Excel Programming 8 September 13th 07 09:35 AM
Hiding columns Richard Excel Programming 1 November 2nd 05 09:24 AM
Hiding columns Adam Excel Discussion (Misc queries) 2 March 31st 05 05:07 PM


All times are GMT +1. The time now is 03:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"