+ Reply to Thread
Results 1 to 2 of 2

Getting colored contents out of a cell

  1. #1
    Registered User
    Join Date
    03-07-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    13

    Getting colored contents out of a cell

    Hello,
    I want to get the colored characters out of a cell. What I did at the moment is that I copied the String in the cell and I have a certain color, which I am looking for. Then I use the following function:

    Function getTasks(CellsValue As String, Color As Long) As String
    If Len(CellsValue) > 0 Then
    For i = 1 To Len(CellsValue)
    If CellsValue.Chars(i).Font.Color = Color Then
    getTasks = getTasks & CellsValue.Char(i)
    End If
    Next i
    End If
    End Function

    But it says "invalid qualifier". Can someone help mewith this please?

  2. #2
    Registered User
    Join Date
    03-07-2014
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Getting colored contents out of a cell

    Okay, I changed the code to this: but it still doesn't get the color of the char :/
    Function getTasks(CellsValue As String, Colors As Long) As String
    If Len(CellsValue) > 0 Then
    For i = 1 To Len(CellsValue)
    If Mid(CellsValue, i, 1).Font.Color = Colors Then
    getTasks = getTasks & Mid(CellsValue, Index, i)
    End If
    Next i
    End If
    End Function

+ 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. Replies: 1
    Last Post: 11-09-2013, 02:43 AM
  2. Replies: 3
    Last Post: 10-16-2013, 03:56 AM
  3. Split cell contents over multiple rows based on cell contents
    By naigy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-17-2011, 05:38 PM
  4. Have blocks of blue colored cells ... want them surrounded by lavender-colored cells
    By rocket1406 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-01-2007, 03:59 PM
  5. How do I make a cell's contents equal to another cell's contents with macro program?
    By mgmcdevitt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-15-2005, 04:44 PM

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