Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Filtering data via VBA code
Hi all! I was wondering if there's a way to program in a filter.
Basically, I have 10 columns...column B contains either of 3 entries: "Bound", "ANB", or "Declined". I want to be able to program a macro to filter for any entries containing the word "Bound" in it, and then copying it and pasting it in another workbook. Then, I want to "unfilter" it and show all data, and I will copy this and paste in another workbook. Can this be done via VBA? Thank you in advance! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Filtering data via VBA code
Sure.
Turn on the macro recorder. Select you data and apply an autofilter (Data=Filter=Autofilter). In this column, select custom from the dropdown and select Contains and type in Bound (or on of your other choices). Then select all you data and do Edit=copy. Move to the destination sheet and do Edit=Paste (only the visible rows will be copied). go back to the original sheet and do Data=Filter=Autofilter to remove the filter. Turn off the macro recorder. Look at the recorded code and modify it to suite your needs. -- Regards, Tom Ogilvy " wrote: Hi all! I was wondering if there's a way to program in a filter. Basically, I have 10 columns...column B contains either of 3 entries: "Bound", "ANB", or "Declined". I want to be able to program a macro to filter for any entries containing the word "Bound" in it, and then copying it and pasting it in another workbook. Then, I want to "unfilter" it and show all data, and I will copy this and paste in another workbook. Can this be done via VBA? Thank you in advance! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Filtering data via VBA code
Sure. Turn on the macro recorder. Do your thing. Turn off the macro
recorder. The code will be in the VBE. If you want help modifying the code, post again. Hth, Merjet |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Filtering of data - autmatically based on data on other sheet | Excel Discussion (Misc queries) | |||
Zip code filtering | Excel Discussion (Misc queries) | |||
filtering of data | Excel Discussion (Misc queries) | |||
Help with Filtering data and matching two data sets? | Excel Programming |