+ Reply to Thread
Results 1 to 11 of 11

How to find colored text

  1. #1
    Registered User
    Join Date
    10-31-2006
    Posts
    14

    How to find colored text

    Hi,

    how to find the blue text in all sheets? I have around 10 sheets and from each sheet if a cell contains text in blue then that row, row number and the sheet name should be captured in a new sheet. Could you please help me do that?

    Thanks

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi,

    One way. Create a new sheet called "Colours", add the following VBA procedure and run the macro. Just check that colour index 5 is the blue colour you're looking for. if not just alter that line in the procedure.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-31-2006
    Posts
    14
    Thanks for the help - However, it seems like it is not working for me. I tried adding a new sheet with the name as "Colours" then I executed the macro but the code didnt work. any more suggestions or tips would be of great help - Thanks!!!!!!!!

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi,

    When you say it's not working, what happens? Do you mean the macro falls over, or you don't get any results listed on the "Colours" sheet.

    Have you checked that you have cells coloured with a background colour index of '5', or are your 'blue' cells a slightly different shade of blue with a different colour index to 5?

    HTH

  5. #5
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573
    Are the font colors due to conditional formatting? It makes a big difference.

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi,

    I now see my mistake. I had misread your original and thought you were talking about the cell background. I now realise you meant the font colour.

    In which case please change this line:

    Please Login or Register  to view this content.
    Rgds

  7. #7
    Registered User
    Join Date
    10-31-2006
    Posts
    14
    well, I have already tried with light blue, dark blue and blue color text but nothing changed in the colours sheet. And Just to add more a particular cell can have mulitple colours
    Last edited by ahmedwaseem2000; 09-08-2008 at 11:47 AM.

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi,

    Have you tried stepping through the macro to see why it is not entering the IF..THEN..END IF test?

    Try colouring the font in A1 on sheet1 and observing why it fails the test.

    Otherwise upload the workbook and I'll take a look.

    Rgds

  9. #9
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573
    With a slight tweak, you can use Richard's code. When you add the extra condtions, extra code will be needed.

    First, get the Blue check to work using Richard's code:
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    10-31-2006
    Posts
    14
    Well, I am completely naive in this coding. However I managed this code and it is partially working. the below code doesnt print the row data where the text is in blue and when the cell has multiple colors its failing. Could you please help me fix this? - Thanks

    Please Login or Register  to view this content.

  11. #11
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573
    It should error. See my code.

    We can always add the other parts as I did below. Each character has to be checked to meet your additional criteria. The Light Blue, 41 and Dark Blue, 11, are easily added in Or's or Select Case.

    Please Login or Register  to view this content.
    Last edited by Kenneth Hobson; 09-08-2008 at 12:50 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Find row number of text string in a range of cells
    By Steven Fleck in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-06-2013, 08:38 PM
  2. Pasting multiple lines of text into one cell
    By hoopz in forum Excel General
    Replies: 4
    Last Post: 07-11-2012, 08:28 PM
  3. Find and colour text for each minimum value in row?
    By John K in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-14-2008, 03:07 PM
  4. text functions - find
    By nabilqu in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-16-2008, 03:43 AM
  5. Find blank rows and insert text
    By bpreas in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-09-2007, 10:43 AM

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