I've been doing alot of research for the past week on this topic and came up with top two answers .
1. you cant do it
2. you can do it but only if it is broken up.
3. find another option.
lets say i want to do this.
and have been trying really hard to find en number of ways.
code 1 by pgc01
----------------------
Private Sub Worksheet_Change(ByVal Target As Range)
Dim s1 As String, s2 As String
' only if D1 changes
If Target.Address <> "$D$1" Then Exit Sub
' write the text in A1
s1 = " The Agreement between (The ""Company"") and "
s2 = " (The ""Customer"")"
Range("A1") = s1 & Range("D1") & s2
' add underline to the format of the words "Company" and "Customer"
Range("A1").Characters(InStr(1, Range("A1"), "Company", vbTextCompare), Len("Company")).Font.Underline = True
Range("A1").Characters(InStr(1, Range("A1"), "Customer", vbTextCompare), Len("Customer")).Font.Underline = True
End Sub
----------------------
(i have been hopping)
code 2 from itags.org
----------------------
Function CopyNumberWithOneUnderlinedCharacter(ByVal myCell As Range)
Dim l_Position As Integer
For l_Position = 1 To Len(myCell.Value)
If myCell.Characters(Start:=l_Position, Length:=1).Font.Underline _
<> xlUnderlineStyleNone Then
CopyNumberWithOneUnderlinedCharacter.Characters(St art:=l_Position,
Length:=1).Font.Underline = xlUnderlineStyleSingle
End If
Next l_Position
End Function
----------------------
therse were the best two answers i could find out for underlineing a part of a sentence in a cell.
now my question here is for some one who can put up a function for a sell only or formatting.
for example
A1 = The
B1 = Cow
C1 = jumped
D1 = over
E1 = the
F1 = moon.
lets say my data is like this. if i really want to join the sentense all i have to do is "=A1&B1&C1&D1&E1&F1" (without quots)
can someone come up with a function to underline just 1 cell
hypothetically C1
thus bringing me to a formula
"=A1&B1&underline(C1)&D1&E1&F1" (without quots)
ideally this should be the case isnt it ?
Any suggestions on how to go about this.... i've just theorized the theory.
Some one help me put this in motion.
1. you cant do it
2. you can do it but only if it is broken up.
3. find another option.
lets say i want to do this.
and have been trying really hard to find en number of ways.
code 1 by pgc01
----------------------
Private Sub Worksheet_Change(ByVal Target As Range)
Dim s1 As String, s2 As String
' only if D1 changes
If Target.Address <> "$D$1" Then Exit Sub
' write the text in A1
s1 = " The Agreement between (The ""Company"") and "
s2 = " (The ""Customer"")"
Range("A1") = s1 & Range("D1") & s2
' add underline to the format of the words "Company" and "Customer"
Range("A1").Characters(InStr(1, Range("A1"), "Company", vbTextCompare), Len("Company")).Font.Underline = True
Range("A1").Characters(InStr(1, Range("A1"), "Customer", vbTextCompare), Len("Customer")).Font.Underline = True
End Sub
----------------------
(i have been hopping)
code 2 from itags.org
----------------------
Function CopyNumberWithOneUnderlinedCharacter(ByVal myCell As Range)
Dim l_Position As Integer
For l_Position = 1 To Len(myCell.Value)
If myCell.Characters(Start:=l_Position, Length:=1).Font.Underline _
<> xlUnderlineStyleNone Then
CopyNumberWithOneUnderlinedCharacter.Characters(St art:=l_Position,
Length:=1).Font.Underline = xlUnderlineStyleSingle
End If
Next l_Position
End Function
----------------------
therse were the best two answers i could find out for underlineing a part of a sentence in a cell.
now my question here is for some one who can put up a function for a sell only or formatting.
for example
A1 = The
B1 = Cow
C1 = jumped
D1 = over
E1 = the
F1 = moon.
lets say my data is like this. if i really want to join the sentense all i have to do is "=A1&B1&C1&D1&E1&F1" (without quots)
can someone come up with a function to underline just 1 cell
hypothetically C1
thus bringing me to a formula
"=A1&B1&underline(C1)&D1&E1&F1" (without quots)
ideally this should be the case isnt it ?
Any suggestions on how to go about this.... i've just theorized the theory.
Some one help me put this in motion.