View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default How to save current filter of Table(ListObject) and to apply i

The variable Rng contains the string address of the filtered items, so you
would use it like the "&A$1" in Range("$A$1"), only without the quote marks.

ActiveSheet.Range(Rng).Copy Sheets(2).Range("A2")

would copy the filtered data to sheet 2, with the top left corner of the
range achored in cell A2.

"Smugliy" wrote:

Sorry,JLGWhiz
How this function helps me ?Its stores filter of table?
How can I apply it from Rng?

"JLGWhiz" wrote:

Sub SetFiltRngToVar()
Rng = Sheets(1).UsedRange.SpecialCells(xlCellTypeVisible ).Address
MsgBox Rng
End Sub

"Smugliy" wrote:

Hi , I am new in Excel Programming .I have following question:
I have an object
Excel.ListObject lo = _currentWS.ListObjects[1];
lo.AutoFilter contains current filter which user activated(for example,
top10, contains ,greater than ... ).

I need to perform
lo.AutoFilter.ShowAllData();
In this case user filter disappear.
What I need to do for saving current filter and applying it after.
Thanks a lot