+ Reply to Thread
Results 1 to 3 of 3

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

  1. #1
    Paul
    Guest

    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. #2
    Tom Ogilvy
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #3
    Paul
    Guest

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



    Thank you again super Tom!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1