Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Using a macro how can I check a worksheet to see if an autofilter is in place
and then show all data. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
With worksheets("Sheet9999")
'to remove the filter and the arrows .AutoFilterMode = False 'or to just show all the data If .FilterMode Then .ShowAllData End If End With RN Mark wrote: Using a macro how can I check a worksheet to see if an autofilter is in place and then show all data. -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
Like this With Worksheets("sheet1") If .FilterMode Then .ShowAllData End If End With Mike "RN Mark" wrote: Using a macro how can I check a worksheet to see if an autofilter is in place and then show all data. |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks Mike,
it worked a treat "Mike H" wrote: Hi, Like this With Worksheets("sheet1") If .FilterMode Then .ShowAllData End If End With Mike "RN Mark" wrote: Using a macro how can I check a worksheet to see if an autofilter is in place and then show all data. |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks Dave, I just required the Filtermode function this time, however I
have noticed in both Mike and your replies you have used If and End If where as I have just used the line 'If ActiveSheet.FilterMode Then ActiveSheet.ShowAllData', without using the End If statement What is the difference between the two and when and why should I be using End If. Mark "Dave Peterson" wrote: With worksheets("Sheet9999") 'to remove the filter and the arrows .AutoFilterMode = False 'or to just show all the data If .FilterMode Then .ShowAllData End If End With RN Mark wrote: Using a macro how can I check a worksheet to see if an autofilter is in place and then show all data. -- Dave Peterson |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
There are two different styles of the "if" statement.
The single line version: if a=b then something else somethingelse and the block version: if a = b then something else somethingelse end if Depending on what you're doing (how complex that something and somethingelse are), you may be able to use that single line. But you can always use the block version. And as a personal preference, I find it easier to read and easier to modify when I need to add more stuff to either the Then or Else portion. On the other hand, I'll sometimes use: if target.cells.count 1 then exit sub So it's not a hard and fast rule for me. BG Mark wrote: Thanks Dave, I just required the Filtermode function this time, however I have noticed in both Mike and your replies you have used If and End If where as I have just used the line 'If ActiveSheet.FilterMode Then ActiveSheet.ShowAllData', without using the End If statement What is the difference between the two and when and why should I be using End If. Mark "Dave Peterson" wrote: With worksheets("Sheet9999") 'to remove the filter and the arrows .AutoFilterMode = False 'or to just show all the data If .FilterMode Then .ShowAllData End If End With RN Mark wrote: Using a macro how can I check a worksheet to see if an autofilter is in place and then show all data. -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do i sort a worksheet data to show repetitve data and show | Excel Worksheet Functions | |||
Autofilter dropdown box doesn't show all the choices in the colum | Excel Discussion (Misc queries) | |||
Autofilter- show dates differently | Excel Discussion (Misc queries) | |||
Why does AutoFilter not show all the data in the pull down? | Excel Discussion (Misc queries) | |||
How can I make autofilter show the filtered number of rows | Excel Worksheet Functions |