LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Dynamic Autofilter using VBA

Hello,

I'm trying to use vba to color-code cells A through M in the visible rows that are chosen based on an autofilter in column M. I was able to do this using the following code which autofilters for the criteria selected in column M and then it scrolls to the first visible cell in the data that I want to color code(in this case cell A345) and then it highlights the visible data and color codes it.

Not sure, though, how to do it dynamically because each month the total number of rows will change (this month , there were 2607) and also the number for records for the selected criteria will change (in this example, the first record with the criteria = "Replaced" was on row 345, but it could be on row 245 next month).

ActiveSheet.Range("$A$1:$Y$2607").AutoFilter Field:=13, Criteria1:= _
"Replaced"
ActiveWindow.ScrollRow = 2585
ActiveWindow.ScrollRow = 337
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Range("A345:M345").Select
Range(Selection, Selection.End(xlDown)).Select
With Selection.Font
.ThemeColor = xlThemeColorDark2
.TintAndShade = -0.499984740745262
End With

Thanks,
Pat
 
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
Dynamic autofilter field merry_fay Excel Discussion (Misc queries) 2 March 17th 10 02:11 PM
Dynamic Autofilter? Sarah (OGI) Excel Discussion (Misc queries) 0 October 8th 07 12:25 PM
Dynamic Chart With Autofilter and Formulae Gadget Charts and Charting in Excel 0 October 27th 05 03:02 PM
dynamic summing of an autofilter 'ed table john boy Excel Discussion (Misc queries) 4 May 19th 05 05:29 AM
Dynamic series range from AutoFilter CLR Charts and Charting in Excel 7 April 15th 05 02:53 PM


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

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"