LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 144
Default Setting Autofilter using code

Hi all,

I have a spreadsheet where as part of my macro I'm copying data from one
sheet to another. Because the sheet which is being copied from will have
Autofilter set on row 1 and because at the time the macro runs the data may
be filtered on a particular value, I believe I need to turn off autofilter so
that I can copy all of the cells in the spreadsheet -- I then need to turn
autofilter back on. Currently I'm doing this with the code below. I tried
using Help to see if I could do something like "If Autofilter is set to True,
then set to False...." but wasn't able to find information regarding doing
this. Is there a way to do this? Thanks in advance!

'FYI - The "Open Transactions by Member ID" sheet has Autofilter set prior
to the macro being run

With Sheets("Open Transactions by Member ID")
.Rows("1:1").AutoFilter
.Cells.Copy
End With
With Sheets("Open Trans by Member ID WIP")
.Cells.PasteSpecial (xlPasteAll)
End With
With Sheets("Open Transactions by Member ID")
.Rows("1:1").AutoFilter
End With


--
Robert
 
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
autofilter macro setting tjb Excel Worksheet Functions 0 June 11th 08 05:36 PM
Setting autofilter at runtime AD108 Excel Programming 2 June 1st 06 08:46 AM
Excel to allow color setting for autofilter drop-down arrow patriceadsl Excel Discussion (Misc queries) 1 April 25th 05 01:16 PM
Setting autofilter criteria peterDavey Excel Programming 1 June 11th 04 09:47 AM
Setting AutoFilter to 1 row of data Greg Bloom Excel Programming 1 September 26th 03 11:09 PM


All times are GMT +1. The time now is 08:08 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"