The following illustrates an approach, the test uses the characters method
to read the font style for each character in the original word string. The
two words are allocated to sWord1 and sWord2, which I show in a MsgBox but
they could be assigned to two cells in your worksheet. I added a check in
case there are no bold characters found. The code processes one cell (A1)
but you will want to process a range using a loop I suspect.
Sub SplitWord()
Dim xC As Integer, sWord1 As String, sWord2 As String
With Cells(1, 1)
For xC = 1 To Len(Trim(.Value))
If .Characters(Start:=xC, Length:=1).Font.FontStyle = "Bold" Then
Exit For
End If
Next xC
If xC < Len(Trim(.Value)) Then
sWord1 = Mid(.Value, 1, xC - 1)
sWord2 = Mid(.Value, xC, Len(Trim(.Value)) - xC + 1)
MsgBox sWord1 & vbCrLf & sWord2
Else
sWord1 = "": sWord2 = ""
MsgBox .Value & " - no bold characters!"
End If
End With
End Sub
--
Regards,
Nigel
"spunkyjon" wrote in message
...
Hi,
I would like to split the contents of a cell into two other cell,
however I am unsure if it is possible in this case.
Here is an example of what I have in each cell:
English word German word
All the cells are the same, with the english word followed by the
German word, The German word is written in bold font and the English
word is not. Is there any way of splitting cells by using the bold
text? There is no other delimeters such as commas in the cells. Also
the words are different lengths and some phrases of 2 or 3 words are
also included
Thanks in advance.