Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
bold text of referenced cell show in formula cell zabcikranch Excel Worksheet Functions 1 February 2nd 10 07:42 PM
Is there way of detecting whether a cell is Bold text? JMB Excel Discussion (Misc queries) 3 October 31st 07 01:23 AM
un-Bold part of text in a cell (automatically) chris Excel Discussion (Misc queries) 2 September 26th 07 10:21 PM
Join bold and non-bold text in one cell bkincaid Excel Discussion (Misc queries) 3 March 21st 06 12:58 AM
VBA - Delete row if cell contents bold text Scott Wagner Excel Programming 5 February 27th 06 10:14 PM


All times are GMT +1. The time now is 04:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"