![]() |
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 |
Stop auto update of filter macro?
Hi... Sorry, how do I "comment them out" or assign to a button?
"Don Guillett" wrote: The event macros are firing it. comment them out and do manually or assign to a button/shape To change your freezewindowunfreezemove cursor to d2freeze -- Don Guillett SalesAid Software "PG Oriel" wrote in message ... 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 |
Stop auto update of filter macro?
Hi its ok... sorted it!!! Thanks!
"PG Oriel" wrote: Hi... Sorry, how do I "comment them out" or assign to a button? "Don Guillett" wrote: The event macros are firing it. comment them out and do manually or assign to a button/shape To change your freezewindowunfreezemove cursor to d2freeze -- Don Guillett SalesAid Software "PG Oriel" wrote in message ... 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 |
Stop auto update of filter macro?
glad to help
-- Don Guillett SalesAid Software "PG Oriel" wrote in message ... Hi its ok... sorted it!!! Thanks! "PG Oriel" wrote: Hi... Sorry, how do I "comment them out" or assign to a button? "Don Guillett" wrote: The event macros are firing it. comment them out and do manually or assign to a button/shape To change your freezewindowunfreezemove cursor to d2freeze -- Don Guillett SalesAid Software "PG Oriel" wrote in message ... 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 |
All times are GMT +1. The time now is 05:04 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com