Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / March 2006

Tip: Looking for answers? Try searching our database.

search for a cell colour and print the cells contents in a new she

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul - 21 Mar 2006 03:37 GMT
hello is there any way to search a worksheet (sheet 1) for cells whose font
colour is red, and then print the contents in another worksheet (sheet 2)?

eg cell a3 contains 3255 and its font  colour is red,  
cell a33 contains 444 and its font colour is red.

I would like to output a3 to sheet 2 a1 and a33 to sheet 2 a2.
I would like to write a procedure which looks for these red cells and output
their values.... not in red... to another worksheet

Thank you for your reply
Tom Ogilvy - 21 Mar 2006 04:01 GMT
In excel 2002 and excel 2003, you can use Edit=>Find to search for formats
in cells.

Turn on the macro recorder and do it manually to get the code.

Look at the FindNext command example in VBA for an example of finding
multiple occurances.

In excel earlier than 2000, you will have to loop throught the range

Sub Abc()
Dim rw as Long, cell as Range
rw = 1
for each cell in activesheet.UsedRange '( or in Selection or Range("B2:F10")
  if cell.interior.colorindex = 3 then
        cell.copy Worksheets("Sheet2").Cells(rw,1)
        rw = rw + 1
  end if
Next
End Sub

Signature

Regards,
Tom Ogilvy

> hello is there any way to search a worksheet (sheet 1) for cells whose font
> colour is red, and then print the contents in another worksheet (sheet 2)?
[quoted text clipped - 7 lines]
>
> Thank you for your reply
Paul - 21 Mar 2006 11:46 GMT
Thank you again super Tom!!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.