Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Macro to Un Hide filtered rows

Here's another method:

Sub Macro2()
Range("A1").Select 'select a cell in the filter range
Const csPWORD As String = "123"
ActiveWorkbook.Worksheets("broker").Unprotect Password:=csPWORD
ActiveSheet.AutoFilterMode = False ' turns off auto filter
ActiveWorkbook.Worksheets("broker").Protect Password:=csPWORD
End Sub

HTH
--
Data Hog


"JeffK" wrote:

I have this Macro

Sub Macro2()
Const csPWORD As String = "123"
ActiveWorkbook.Worksheets("broker").Unprotect Password:=csPWORD
ActiveSheet.ShowAllData
ActiveWorkbook.Worksheets("broker").Protect Password:=csPWORD
End Sub

I get a bug error if the sheet is already un filtered and the next step of
protecting the sheet again doesn't happen. How do I change this to search
first to see if the worksheet is filtered and if it is then proceed with the
rest of the Macro.

Reply
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
Macro code to hide rows and not calculate hidden rows bradmcq Excel Discussion (Misc queries) 0 September 1st 09 12:38 AM
Delete all filtered rows from a macro? Joe M Excel Programming 1 February 3rd 09 10:46 PM
Macro to hide rows? Cam Excel Programming 1 April 22nd 08 07:23 PM
Macro for counting the number of filtered rows DGillham[_5_] Excel Programming 4 January 9th 06 02:08 PM
Filtered Visible Rows & VBA Non-Filtered Rows Displayed QTE[_15_] Excel Programming 8 July 11th 04 02:21 AM


All times are GMT +1. The time now is 06:50 AM.

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"