Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting Bold text into a cell
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Inserting Bold text into a cell
Adapt this to suit
Sub boldtext() Set mr = Range("l1") mr.Font.Bold = False mr.Value = "Value1: " & 11111 & " Value 2: " & 22222222 p1 = InStr(mr, ":") MsgBox p1 p2 = InStr(mr, " Value 2") MsgBox p2 p3 = InStr(p2, mr, ":") MsgBox p3 mr.Characters(1, p1).Font.Bold = True mr.Characters(p2, p3 - p2 + 1).Font.Bold = True End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
bold text of referenced cell show in formula cell | Excel Worksheet Functions | |||
Is there way of detecting whether a cell is Bold text? | Excel Discussion (Misc queries) | |||
un-Bold part of text in a cell (automatically) | Excel Discussion (Misc queries) | |||
Join bold and non-bold text in one cell | Excel Discussion (Misc queries) | |||
VBA - Delete row if cell contents bold text | Excel Programming |