Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default search for a cell colour and print the cells contents in a new she

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default search for a cell colour and print the cells contents in a new she

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

--
Regards,
Tom Ogilvy

"Paul" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default search for a cell colour and print the cells contents in a new



Thank you again super Tom!!
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 do i change the colour of a cell according to the contents? ChrisC Excel Discussion (Misc queries) 2 October 10th 08 09:58 PM
excel - formula to copy the cell contents and colour. Possible? Jason Excel Discussion (Misc queries) 3 August 24th 07 10:05 PM
search if cell contents exist in other cells CharileBaker Excel Worksheet Functions 1 April 12th 07 11:00 AM
Changing Cell Contents Colour Spiller Excel Discussion (Misc queries) 3 November 24th 06 01:40 PM
Changing Background Colour Based on Cell Contents Sukh Excel Programming 4 January 12th 06 12:56 PM


All times are GMT +1. The time now is 12:57 PM.

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"