Result | ||||
1 | 2 | 3 | 4 | 1234 |
1 | 3 | 13 |
i had one code but it doesnt work well.....
VBA Code:
Sub SetValue()
Dim s1 As String
Dim s2 As String
Dim s3 As String
Dim s4 As String
s1 = Range("A2").Text
s2 = Range("B2").Text
s3 = Range("C2").Text
s4 = Range("D2").Text
Range("E2").Value = s1 & s2 & s3 & s4
With Range("E2").Characters(1, Len(s1)).Font
.Name = Range("A2").Font.Name
.Color = Range("A2").Font.Color
.Bold = Range("A2").Font.Bold
.Italic = Range("A2").Font.Italic
End With
With Range("E2").Characters(Len(s1) + 1).Font
.Name = Range("B2").Font.Name
.Color = Range("B2").Font.Color
.Bold = Range("B2").Font.Bold
.Italic = Range("B2").Font.Italic
End With
With Range("E2").Characters(Len(s1) + 2).Font
.Name = Range("C2").Font.Name
.Color = Range("C2").Font.Color
.Bold = Range("C2").Font.Bold
.Italic = Range("C2").Font.Italic
End With
With Range("E2").Characters(Len(s1) + 3).Font
.Name = Range("D2").Font.Name
.Color = Range("D2").Font.Color
.Bold = Range("D2").Font.Bold
.Italic = Range("D2").Font.Italic
End With
End Sub