Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Autofilter Copy Problem

Status
Not open for further replies.

robcarr

Programmer
May 15, 2002
633
GB
Hi,

I am using the below coding (this is the part that is causing a problem) to copy specific data from an autofilter to another report.

Code:
Application.CutCopyMode = 0
Application.CutCopyMode = 0
  Application.Wait Now + (TimeValue("00:00:05"))
   Range(Range("c65536").End(xlUp), Range("a" & rs)).Copy
   Windows(aname).Activate
   Sheets("Agent Names").Activate
   Range("g1").PasteSpecial xlPasteValues
   Range("H1", Range("h65536").End(xlUp)).Copy
   Sheets("data").Activate
   Range("a65536").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
   Sheets("Agent Names").Activate
   Range("g1", Range("g65536").End(xlUp)).Copy
   Sheets("data").Activate
   Range("b65536").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
   Sheets("Agent Names").Activate
   Range("i1", Range("i65536").End(xlUp)).Copy
   Sheets("data").Activate
   Range("c65536").End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
   Sheets("Agent Names").Activate
   Range("g1", Range("i65536").End(xlUp)).ClearContents
   Sheets("data").Activate
    ActiveCell.Offset(0, 3).Activate
    Windows(wname).Activate
    Application.CutCopyMode = 0
    Application.CutCopyMode = 0
      Application.Wait Now + (TimeValue("00:00:05"))
    Range(Range("ae" & rs), Range("ag65536").End(xlUp)).Copy

[\code]

the coding does not copy just the filtered data, what i mean is if you open a report and filter data and then press the copy button twice it copies all data within the selection  and not just the visible cells. How can i get it to guarantee to copy the visible cells only.

thanks in advance

[COLOR=red][b][i][u]Hope this is of use, Rob.[/u][/i][/b][/color][yoda]
 
dont worry i was being special , have sorted it now

Hope this is of use, Rob.[yoda]
 


Hi,

You seem to be going thru alot of trouble.

Are you copying ALL of the visible data to the other sheet (ALL columns and ALL visible rows)?

Is this just for ONE criteria, or several iterations involving several different criteria?

Skip,
[glasses]Don't let the Diatribe...
talk you to death![tongue]

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
this is taking data from my master file to populate a new report that uses a alot of formulas I have to move a certain amount of data depending on filter (all visible data on certain columns) to the new report.



Hope this is of use, Rob.[yoda]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top