PC Review


Reply
Thread Tools Rate Thread

Copy Paste with fiter and hide copies filtered and hidden

 
 
New Member
Join Date: Mar 2010
Location: Portland, OR
Posts: 1
 
      19th Mar 2010
Hello all,

I am working on my first macro in Excel 2007 on Window XP Pro. The purpose of the macro is to data based on auto filters from multiple tabs and paste the copied data to a new workbook. The original workbook has 12 columns and the new one only needs data from 2 of these. The macro I built works great unless there is no data left after the filters are applied then it copies all of the data on the spreadsheet that was filtered and hidden. Here is a piece of the macro that I am working on.

Columns("A:L").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$L$900").AutoFilter Field:=9, Criteria1:="="
ActiveSheet.Range("$A$1:$L$900").AutoFilter Field:=4, Criteria1:="<>"
ActiveSheet.Range("$A$1:$L$900").AutoFilter Field:=8, Criteria1:="<>"
Columns("A:B").Select
Selection.EntireColumn.Hidden = True
Columns("E:L").Select
Selection.EntireColumn.Hidden = True
Rows("1:1").Select
Selection.EntireRow.Hidden = True
Selection.CurrentRegion.Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Range("A1").End(xlDown).Offset(1, 0).Select
Windows("AutoRemitTesting.xls").Activate
Sheets("Medicare").Select

The code repeats for each tab on the workbook then saves the new workbook and removes the filters and unhides everything.

I have built it thus far by trial and error and alot of help from reading forums but I can't find anything that helps me solve this issue. Any help would be greatly appreciated.

Thanks!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy and Paste with hidden columns remaining hidden Pendelfin Microsoft Excel Misc 2 26th Feb 2009 11:35 AM
COPY PASTE with FILTER copies anti-filtered results as hidden rows BlueWolverine Microsoft Excel Programming 2 16th Feb 2009 05:33 PM
paste data over hidden cells that are filtered derwood Microsoft Excel Worksheet Functions 1 9th Mar 2008 02:11 AM
copy/paste with hidden rows don't want hidden parts to paste =?Utf-8?B?cm9ieW5uZQ==?= Microsoft Excel Misc 1 21st Sep 2007 09:23 PM
Keeping hidden columns HIDDEN in a copy-and-paste leojbramble Microsoft Excel Discussion 1 21st Oct 2003 05:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:38 AM.