View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
milo milo is offline
external usenet poster
 
Posts: 22
Default Copy filtered range

Hi all,

In VBA, if I auto filter a range and than do a simple copy and paste into
another worksheet only the filtered values are copied. That is good. But if I
do the same but use arrays to transfer the filtered worksheet than everything
gets transferred, even the stuff that I have filtered. Since I prefer to use
arrays rather than copy and paste, how is this done so that only the filtered
values are captured?

Roughly the non-working code I use is as follows.

Selection.AutoFilter Field:=3, Criteria1:=something
LastRow = LastRowInColumn("A")
tempArr = Range("A1:H" & CStr(LastRow)).Value
Sheets(something).Select
Range("A1:H" & CStr(LastRow)).Value = tempArr

Thanks for any tips.
Milos.