Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need a UDF that will return the underlined part of a text string. For
example, if cell A1 contains the string "hello world" and "world" is underlined, then UnderCap(A1) would return "world" -- Gary''s Student |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Function WhatIsUnderlined(inp)
Dim sTemp As String Dim i As Long WhatIsUnderlined = "" If TypeOf inp Is Range Then If inp.Count = 1 Then sTemp = inp.Value Else WhatIsUnderlined = "#Too many cells" Exit Function End If Else WhatIsUnderlined = "#Wrong argument type" End If For i = 1 To Len(inp) If inp.Characters(i, 1).Font.Underline = 2 Then WhatIsUnderlined = WhatIsUnderlined & Mid(sTemp, i, 1) End If Next i End Function -- HTH Bob Phillips "Gary''s Student" wrote in message ... I need a UDF that will return the underlined part of a text string. For example, if cell A1 contains the string "hello world" and "world" is underlined, then UnderCap(A1) would return "world" -- Gary''s Student |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Bob!!
Your approach can also be adapted to other special font characteristics -- Gary''s Student "Bob Phillips" wrote: Function WhatIsUnderlined(inp) Dim sTemp As String Dim i As Long WhatIsUnderlined = "" If TypeOf inp Is Range Then If inp.Count = 1 Then sTemp = inp.Value Else WhatIsUnderlined = "#Too many cells" Exit Function End If Else WhatIsUnderlined = "#Wrong argument type" End If For i = 1 To Len(inp) If inp.Characters(i, 1).Font.Underline = 2 Then WhatIsUnderlined = WhatIsUnderlined & Mid(sTemp, i, 1) End If Next i End Function -- HTH Bob Phillips "Gary''s Student" wrote in message ... I need a UDF that will return the underlined part of a text string. For example, if cell A1 contains the string "hello world" and "world" is underlined, then UnderCap(A1) would return "world" -- Gary''s Student |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Even better Gary ;-)
Bob "Gary''s Student" wrote in message ... Thank you Bob!! Your approach can also be adapted to other special font characteristics -- Gary''s Student "Bob Phillips" wrote: Function WhatIsUnderlined(inp) Dim sTemp As String Dim i As Long WhatIsUnderlined = "" If TypeOf inp Is Range Then If inp.Count = 1 Then sTemp = inp.Value Else WhatIsUnderlined = "#Too many cells" Exit Function End If Else WhatIsUnderlined = "#Wrong argument type" End If For i = 1 To Len(inp) If inp.Characters(i, 1).Font.Underline = 2 Then WhatIsUnderlined = WhatIsUnderlined & Mid(sTemp, i, 1) End If Next i End Function -- HTH Bob Phillips "Gary''s Student" wrote in message ... I need a UDF that will return the underlined part of a text string. For example, if cell A1 contains the string "hello world" and "world" is underlined, then UnderCap(A1) would return "world" -- Gary''s Student |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IME MODE FOR EXCEL 2007 (URGENT URGENT) | Excel Discussion (Misc queries) | |||
Urgent Help!!! | Excel Worksheet Functions | |||
Urgent-Urgent VBA LOOP | Excel Discussion (Misc queries) | |||
Macro help urgent urgent | Excel Programming | |||
Macro help urgent urgent | Excel Programming |