2. Write your function here
Such as here is the function to get Red text in a Cell. It's very useful :)
Function GetRedText(pRange As Range) As String
Dim xOut As String
Dim xValue As String
Dim i As Long
xValue = pRange.Text
For i = 1 To VBA.Len(xValue)
If pRange.Characters(i, 1).Font.Color = vbRed Then
xOut = xOut & VBA.Mid(xValue, i, 1)
End If
Next
GetRedText = xOut
End Function
No comments:
Post a Comment