ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Auto Fillter data and copy to other table (https://www.excelbanter.com/excel-programming/354280-auto-fillter-data-copy-other-table.html)

[email protected]

Auto Fillter data and copy to other table
 
I have a column, which i would like to filter and copy the filtered
data to other sheet.
The filter criteria should be the items in the same column.
Like using the auto filter.
I know how to apply Auto filter - Selection.AutoFilter Field:=1,
Criteria1:="xyz", but how to get this "xyz" from the values in that
column?
Should I loop throght the column cells, and somehow filter the items?
I am lost?

Also when looping throught column, how to stop if cell is empty?

thanks


funkymonkUK[_90_]

Auto Fillter data and copy to other table
 

RANGE(\"A7\").SELECT ' ANY CELL ON THE TOP OF YOUR HEADING
SELECTION.AUTOFILTER ' ADDS AUTO FILTER
SELECTION.AUTOFILTER FIELD:=1, CRITERIA1:=\"XYZ\" ' SELECTS THE
CRITIRIA I.E 1= FIRST COLUMN. XYZ=WHAT YOU WANT TO FILTER IT BY
SELECTION.CURRENTREGION.SELECT ' SELECTS THE RESULTS
SELECTION.COPY ' COPYS THE RESULTS
WORKBOOKS.ADD ' ADDS WORKBOOK
ACTIVESHEET.PASTE ' PASTES THE RESULTS
APPLICATION.CUTCOPYMODE = FALSE ' TURNS OFF THE COPY FEATURE


Hope that helps let me know if you have any questions


--
funkymonkUK
------------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...o&userid=18135
View this thread: http://www.excelforum.com/showthread...hreadid=516151


[email protected]

Auto Fillter data and copy to other table
 
The problem is that i want to filter it by the contens of the column.

let's say i have the following column
xyz
xyz
xyz
xyz
zyx
zyx
zyx
yxz
yxz
yxz


i would like to filter and copy data for every single item - first for
"xyz", second "zyx", third "yxz",

don't know how to do it


funkymonkUK[_95_]

Auto Fillter data and copy to other table
 

how many different values are there that you want to filter.

it is not to long just copy the copy the amount of times and then you
should be able to paste it in different workbooks or sheets.

I think a "Do Loop" is in needed however I am not sure how to do a loop
with autofilter.


--
funkymonkUK
------------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...o&userid=18135
View this thread: http://www.excelforum.com/showthread...hreadid=516151



All times are GMT +1. The time now is 03:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com