Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Highlite filtered items
Howdy,
Have a worksheet for entry, with a macro that copies filtered ranges to another sheet. Is there any way to have code to highlite only the cells in the pasted range that contain the filter criteria? Example: filter on Column C, 4 rows copied to sheet 2, highlight the 4 cells in Sheet 2, Column C that contain the filter criteria. Multiple sets get copied, based on different columns being filtered. Any help is greatly appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Highlite filtered items
Please post the code of your macro..
HTH -- AP "Hugh" not.com" a écrit dans le message de ... Howdy, Have a worksheet for entry, with a macro that copies filtered ranges to another sheet. Is there any way to have code to highlite only the cells in the pasted range that contain the filter criteria? Example: filter on Column C, 4 rows copied to sheet 2, highlight the 4 cells in Sheet 2, Column C that contain the filter criteria. Multiple sets get copied, based on different columns being filtered. Any help is greatly appreciated. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Highlite filtered items
Sub Abd()
Dim f As Filter Dim rng As Range ' Autofilter range Dim rng1 As Range ' Visible cells of col 1 Dim rng2 As Range ' destination Dim rng4 As Range ' Data only in autofilter rng Set rng = ActiveSheet.AutoFilter.Range Set rng4 = rng.Offset(1, 0).Resize(rng.Rows.Count - 1) Set rng1 = rng.Columns(1).SpecialCells(xlVisible) If rng1.Count 1 Then With Worksheets("Sheet3") Set rng2 = .Cells(Rows.Count, 1).End(xlUp)(3) Set rng2 = rng2.Resize(rng1.Count - 1, _ rng.Columns.Count) End With rng4.Copy Destination:=rng2(1) i = 0 For Each f In ActiveSheet.AutoFilter.Filters i = i + 1 If f.On Then rng2.Columns(i).Interior.ColorIndex = 6 End If Next End If End Sub -- Regards, Tom Ogilvy "Hugh" not.com" wrote in message ... Howdy, Have a worksheet for entry, with a macro that copies filtered ranges to another sheet. Is there any way to have code to highlite only the cells in the pasted range that contain the filter criteria? Example: filter on Column C, 4 rows copied to sheet 2, highlight the 4 cells in Sheet 2, Column C that contain the filter criteria. Multiple sets get copied, based on different columns being filtered. Any help is greatly appreciated. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Highlite filtered items
Tom - that's absolutly boffo!
Many thanks!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
extract items from filtered list | Excel Worksheet Functions | |||
items filtered | Excel Discussion (Misc queries) | |||
cut and paste filtered items | Excel Discussion (Misc queries) | |||
counting filtered items | Excel Worksheet Functions | |||
Highlite Items | Excel Programming |