The following code was provided by a member a year ago
{code]
Private Sub UserForm_Activate()
Dim firstpos As Integer, lastpos As Integer
Inktext.Text = "And Jesus Said to him," & Chr(34) & _
"therefore when you see the abomination of desolation standing in the Holy Place. " & Chr(34) & _
"(let the reader understand) " & Chr(34) & _
"& Chr(34) & then let him " & Chr(34) & _
"who is in Judea flee to the mountains. " & Chr(34) & _
" Matthew 24:15-16 "
Inktext.SelStart = 0
Inktext.SelLength = Len(Inktext.Text)
Inktext.SelColor = vbBlue
Inktext.SelFontSize = 18
firstpos = InStr(1, Inktext.Text, Chr(34))
lastpos = InStr(firstpos + 1, Inktext.Text, Chr(34))
Inktext.SelStart = firstpos
Inktext.SelLength = lastpos - firstpos - 1
Inktext.SelColor = vbRed
Inktext.SelLength = 0
End Sub
[/code]
I've tried and tried to replicate his code solution to add more red text, but I can't seem to figure out where and which marker
code symbols should be used and placed to display any starting and ending red text substring anywhere. See image below.
I have to do this for 3,000+ words, and I'm willing to go full throttle til its done. I just need someone who
understands how to do this based on the code block above that displays the section of red text in the image below.
(I don't find this type of textbox the easiest to use, but seems to be the only alternative in Excel to display red text substrings on a userform textbox)
Thanks sincerely for anyone's help and guidance.
cr
{code]
Private Sub UserForm_Activate()
Dim firstpos As Integer, lastpos As Integer
Inktext.Text = "And Jesus Said to him," & Chr(34) & _
"therefore when you see the abomination of desolation standing in the Holy Place. " & Chr(34) & _
"(let the reader understand) " & Chr(34) & _
"& Chr(34) & then let him " & Chr(34) & _
"who is in Judea flee to the mountains. " & Chr(34) & _
" Matthew 24:15-16 "
Inktext.SelStart = 0
Inktext.SelLength = Len(Inktext.Text)
Inktext.SelColor = vbBlue
Inktext.SelFontSize = 18
firstpos = InStr(1, Inktext.Text, Chr(34))
lastpos = InStr(firstpos + 1, Inktext.Text, Chr(34))
Inktext.SelStart = firstpos
Inktext.SelLength = lastpos - firstpos - 1
Inktext.SelColor = vbRed
Inktext.SelLength = 0
End Sub
[/code]
I've tried and tried to replicate his code solution to add more red text, but I can't seem to figure out where and which marker
code symbols should be used and placed to display any starting and ending red text substring anywhere. See image below.
I have to do this for 3,000+ words, and I'm willing to go full throttle til its done. I just need someone who
understands how to do this based on the code block above that displays the section of red text in the image below.
(I don't find this type of textbox the easiest to use, but seems to be the only alternative in Excel to display red text substrings on a userform textbox)
Thanks sincerely for anyone's help and guidance.
cr