Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 11
Default Need help with AutoFilter coding

I'm using Excel 2003. Source data is a database-created spreadsheet of a random amount of rows (anywhere from 3k-4k) with everchanging data. My header row is row "2". My current coding is not functioning properly:

Selection.AutoFilter Field:=8, Criteria1:="DD"
Range("H3").Select
ActiveCell.FormulaR1C1 = "DDM"
Range("H3").Select
Selection.Copy
Range("H4:H5000").Select
ActiveSheet.Paste

Selection.AutoFilter Field:=8, Criteria1:="DM"
Range("H3").Select
ActiveCell.FormulaR1C1 = "DDM"
Range("H3").Select
Selection.Copy
Range("H4:H5000").Select
ActiveSheet.Paste
Selection.AutoFilter Field:=8

Within column H/8, I initially start with only three possible three values: CC,DD,DM. I'm trying to modify my code to separately filter all the instances of "DD" and "DM" and consolidate them into a new, joint value "DDM". The desired result would be all the column results either being CC or DDM.

I have reason to believe that my coding is not functioning due to my H3 reference which obviously could filter into any three values. However, I do need to the consolidation changes to accurately update anything in the H4:H5000 range. Ironically, other macros using the same scrubbing code seem to work properly.

I know how to do this manually, but need to find functional VBA macro code.

Any assistance you can offer would be greatly appreciated.

Thanks...
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
How to fix the coding? Eric Excel Worksheet Functions 0 February 26th 08 03:38 AM
2007 Autofilter worse than 2003 Autofilter jsky Excel Discussion (Misc queries) 9 October 31st 07 12:14 AM
Coding metaltecks Excel Discussion (Misc queries) 1 April 17th 06 10:12 PM
How to Sort within AutoFilter with Protection on (and AutoFilter . giblon Excel Discussion (Misc queries) 1 February 16th 06 12:23 PM
coding Hardy Excel Discussion (Misc queries) 1 February 22nd 05 04:58 PM


All times are GMT +1. The time now is 02:58 PM.

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

About Us

"It's about Microsoft Excel"