Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Highlite filtered items

Tom - that's absolutly boffo!
Many 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
extract items from filtered list andy62 Excel Worksheet Functions 1 April 21st 09 10:01 PM
items filtered roxanne Excel Discussion (Misc queries) 2 October 15th 07 03:52 PM
cut and paste filtered items ferde Excel Discussion (Misc queries) 1 December 6th 05 03:41 PM
counting filtered items mar10 Excel Worksheet Functions 3 August 25th 05 08:09 PM
Highlite Items smandula Excel Programming 6 July 24th 05 08:02 PM


All times are GMT +1. The time now is 05:31 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"