Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filtering of data - autmatically based on data on other sheet uptonfamilywa Excel Discussion (Misc queries) 1 June 20th 09 12:46 AM
Zip code filtering Zack Excel Discussion (Misc queries) 1 September 25th 08 06:46 PM
filtering of data furqan Excel Discussion (Misc queries) 0 December 31st 07 10:49 AM
Help with Filtering data and matching two data sets? masai_chadi Excel Programming 2 March 1st 04 10:33 PM


All times are GMT +1. The time now is 05:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"