+ Reply to Thread
Results 1 to 3 of 3

How can I detect if the text in a cell is underlined?

Hybrid View

  1. #1
    plh
    Guest

    How can I detect if the text in a cell is underlined?

    Hello all,
    I need to detect if the text in a given cell is underlined or not.
    I tried:
    If Sheets("Parts List").Cells(TITLEROW, intC).Underline = xlUnderlineStyleSingle Then
    But I get:
    "Object doesn't support this property or method"
    same with:
    If Sheets("Parts List").Cells(TITLEROW, intC).Underline.xlUnderlineStyleSingle = True Then
    I have to admit, at this point I am guessing.
    Does anyone know the right way to do this?
    Thank You,
    -plh


    --
    I keep hitting "Esc" -- but I'm still here!
    Last edited by zbor; 02-18-2015 at 01:03 PM. Reason: Code tags

  2. #2
    Jim Cone
    Guest

    Re: How can I detect if the text in a cell is underlined?

    Jim Cone
    San Francisco, USA


    Function AnySupport(ByRef rngCells As Excel.Range) As Variant
    Dim varUL As Variant
    varUL = (rngCells.Font.Underline <> xlUnderlineStyleNone)
    If IsNull(varUL) Then
    AnySupport = "Some cells are underlined  "
    Else
    AnySupport = varUL
    End If
    Set rngCells = Nothing
    End Function
    
    Sub FindOut()
    MsgBox AnySupport(Excel.Selection), , " Underlined Font ?"
    End Sub
    Last edited by zbor; 02-18-2015 at 01:05 PM.

  3. #3
    plh
    Guest

    Re: How can I detect if the text in a cell is underlined?

    Thank You!
    -plh
    Last edited by zbor; 02-18-2015 at 01:05 PM.

+ 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