thk12205
04-09-2018, 05:22 PM
Is there a way to identify and copy only the bold text of a cell that has both bold and unbolded text?
example:
Range ("A1") = title details
string1 = BoldOnly(Range("A1"))
string1 = title
string2 = unBoldOnly(Range("A1"))
string2 = details
Attached is my first attempt. It only provide values if entire cell is bold.
Function BoldOnly(WorkRng As Range)
If WorkRng.Font.Bold Then
BoldOnly = WorkRng.Value
End If
End Function
Sub CopyPasteBoldOnly()
For rowNum = 2 To 49
Cells(rowNum, "C") = GetBold(Cells(rowNum, "L"))
Next
End Sub
example:
Range ("A1") = title details
string1 = BoldOnly(Range("A1"))
string1 = title
string2 = unBoldOnly(Range("A1"))
string2 = details
Attached is my first attempt. It only provide values if entire cell is bold.
Function BoldOnly(WorkRng As Range)
If WorkRng.Font.Bold Then
BoldOnly = WorkRng.Value
End If
End Function
Sub CopyPasteBoldOnly()
For rowNum = 2 To 49
Cells(rowNum, "C") = GetBold(Cells(rowNum, "L"))
Next
End Sub