Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Sub ShowAll_Records()

I need to alter the code in the first sub to where if the option in
the second sub does not filter out any records, then the command
"ActiveSheet.showalldata" will not execute.


Sub ShowAll_Records()

Sheets("Input").Select
ActiveSheet.ShowAllData
End Sub


Sub HideZeros()

Range("Start").Offset(3, 0).CurrentRegion.AdvancedFilter
Action:=xlFilterInPlace, CriteriaRange:= _
Range("Criti"), Unique:=False
Range("S12").Select
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Sub ShowAll_Records()


With worksheets("Input")
'to remove the filter and the arrows
.AutoFilterMode = False

'or to just show all the data and keep the arrows
If .FilterMode Then
.ShowAllData
End If
End With


You could have ignored the error, too:

on error resume next
ActiveSheet.ShowAllData
on error goto 0



Revenue wrote:

I need to alter the code in the first sub to where if the option in
the second sub does not filter out any records, then the command
"ActiveSheet.showalldata" will not execute.

Sub ShowAll_Records()

Sheets("Input").Select
ActiveSheet.ShowAllData
End Sub

Sub HideZeros()

Range("Start").Offset(3, 0).CurrentRegion.AdvancedFilter
Action:=xlFilterInPlace, CriteriaRange:= _
Range("Criti"), Unique:=False
Range("S12").Select
End Sub


--

Dave Peterson
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



All times are GMT +1. The time now is 06:58 PM.

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

About Us

"It's about Microsoft Excel"