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: 37
Default Stop auto update of filter macro?

Hi, I have the following in a sheet that automatically updates the columns.
is there any way of getting it to not auto update, and also, i have my top
row as a frozen pane. is there a way of freezing columns A,B and C as well,
and if so how?

Thanks
Paul

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(2, "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(2, i).Resize(rngA.Rows.Count, 1)
If Application.Subtotal(2, 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
auto filter within a macro Sean Excel Discussion (Misc queries) 4 March 27th 08 11:04 AM
Auto-Filter within a Macro jeannie v Excel Discussion (Misc queries) 1 June 17th 07 10:59 AM
Auto Filter Macro Snakeoids Excel Discussion (Misc queries) 10 August 24th 05 08:46 PM
Auto filter macro Ali[_3_] Excel Programming 3 December 12th 03 02:05 PM
Auto Filter in a macro hawkeyes2002[_2_] Excel Programming 0 November 14th 03 11:41 PM


All times are GMT +1. The time now is 12:10 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"