Hello everyone, I have encountered the following scenario. I need to concatenate two cells into a third cell while adding a ": " to act as a divider between the two, in columns 1000 cells deep. I also need to make the divider and all text before it BOLD. I have been using the following code from http://www.mrexcel.com/forum/excel-questions/352267-concatenate-bold-excel-2007-a.html:
[TABLE="width: 64"]
<colgroup><col width="64" style="width: 48pt;">
<tbody>[TR]
[TD="width: 64, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]
Sub BoldPartText()
Dim Part1Len, Part2Len, DividerLen As Integer
Dim Divider As String
Part1Len = Len(Range("F3")) + 1
Part2Len = Len(Range("G3"))
Divider = ": "
DividerLen = Len(Divider)
Range("E3") = Range("F3") & Divider & Range("G3")
With Range("E3").Characters(Start:=1, Length:=Part1Len).Font
.FontStyle = "Bold"
End With
End Sub
[TABLE="width: 64"]
<colgroup><col width="64" style="width: 48pt;">
<tbody>[TR]
[TD="width: 64, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]
This works fine but it only works on one row (row 3). I am a novice at VBA and I don't understand the change I need to make so that all cells from F3:F1001 and G3:G1001 are concatenated and the output put into cells E3:E1001 with just one use of the macro.[TABLE="width: 64"]
<colgroup><col width="64" style="width: 48pt;">
<tbody>[TR]
[TD="width: 64, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]
Can anyone help please? I am on Excel 2010. Thanks.
[TABLE="width: 64"]
<colgroup><col width="64" style="width: 48pt;">
<tbody>[TR]
[TD="width: 64, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]
Sub BoldPartText()
Dim Part1Len, Part2Len, DividerLen As Integer
Dim Divider As String
Part1Len = Len(Range("F3")) + 1
Part2Len = Len(Range("G3"))
Divider = ": "
DividerLen = Len(Divider)
Range("E3") = Range("F3") & Divider & Range("G3")
With Range("E3").Characters(Start:=1, Length:=Part1Len).Font
.FontStyle = "Bold"
End With
End Sub
[TABLE="width: 64"]
<colgroup><col width="64" style="width: 48pt;">
<tbody>[TR]
[TD="width: 64, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]
This works fine but it only works on one row (row 3). I am a novice at VBA and I don't understand the change I need to make so that all cells from F3:F1001 and G3:G1001 are concatenated and the output put into cells E3:E1001 with just one use of the macro.[TABLE="width: 64"]
<colgroup><col width="64" style="width: 48pt;">
<tbody>[TR]
[TD="width: 64, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[/TR]
</tbody>[/TABLE]
Can anyone help please? I am on Excel 2010. Thanks.