Manipulating Text

  • Thread starter Thread starter Ali
  • Start date Start date
A

Ali

How can you CONCATENATE a cell and make one letter that
you extract bold?

Thanks for your help.
 
Ali

=CONCATENATE(A1,B1)
=A1&" "&B1

Both give similar results. But you cannot embolden one
letter of a formula - this must be done in text.

The following macro make the first letter of a selection
bold. I assume that you know how to run it.

Sub BoldLeft()

For Each c In Selection
c.Select
With ActiveCell.Characters(Start:=1, Length:=1).Font
.Name = "Arial"
.FontStyle = "Bold"
End With
Next c

End Sub
 
You can't using a formula - only constants can have character
formatting (although I'm not sure, if you're concatenating, what
you're then extracting).

You can use an Event macro to both concatenate and make one letter
bold. For instance, if you have:

J1: =A1 & C1

and you want the first letter of the text in C1 to be bold, then
instead you can use:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Intersect(Target, Range("A1,C1")) Is Nothing Then
With Range("J1")
.Value = Range("A1").Text & Range("C1").Text
.Characters(Len(Range("A1").Text) + 1, 1).Font.Bold = True
End With
End If
End Sub

this needs to go in the worksheet code module (right-click the sheet
tab and choose view code)
 
Thanks guys!

-----Original Message-----
You can't using a formula - only constants can have character
formatting (although I'm not sure, if you're concatenating, what
you're then extracting).

You can use an Event macro to both concatenate and make one letter
bold. For instance, if you have:

J1: =A1 & C1

and you want the first letter of the text in C1 to be bold, then
instead you can use:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Intersect(Target, Range("A1,C1")) Is Nothing Then
With Range("J1")
.Value = Range("A1").Text & Range("C1").Text
.Characters(Len(Range("A1").Text) + 1, 1).Font.Bold = True
End With
End If
End Sub

this needs to go in the worksheet code module (right- click the sheet
tab and choose view code)



.
 
Back
Top