View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein \(MVP - VB\)[_2458_] Rick Rothstein \(MVP - VB\)[_2458_] is offline
external usenet poster
 
Posts: 1
Default Inserting Bold text into a cell

Something like this should work...

With Cells(i + 1, j)
.Characters.Delete
.Value = " Value 1 :- " & k1 & " Value 2 :- " & k2
With .Characters(InStr(.Value, k1), Len(k1))
.Font.Name = "Tahoma"
.Font.Bold = True
.Font.Italic = True
End With
With .Characters(InStr(InStr(.Value, "Value 2"), .Value, k2), Len(k2))
.Font.Name = "Tahoma"
.Font.Bold = True
.Font.Italic = True
End With
End With

I think good practice would be to qualify your Cells(i + 1, j) reference
with a reference to the worksheet they are on.

Rick


"Ak Man" wrote in message
...
Can someone help me out with this:
Cells(i + 1, j).Value = " Value 1 :- " & Str1(k) & " Value 2 :- " &
Str2(k)
In this I want to have the texts "Value 1 :- " and " Value 2 :- " as Bold,
italic and with font as Tahoma (Just bold will also do)

--
Ak