Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default HOW TO FORMATE PART OF TEXT FROM TEXT STRING

Hi,
Thanks a lot in advance for your help which will help me a lot.

I wanna to bold the part of text from the text string which is in one
cell,this is the string which is joined from different cells into one cell by
using function "CONCATENATE".

Here is the formula to be used
=CONCATENATE("I have ",C42," Rs with me.")
result ;
I have 500 Rs with me.

I wanna to do "500" bold, is there any way for this.

Waiting for the reply,
Regards,
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default HOW TO FORMATE PART OF TEXT FROM TEXT STRING

Not as long as it is part of a formula.


--


Regards,


Peo Sjoblom


"Vishal" wrote in message
...
Hi,
Thanks a lot in advance for your help which will help me a lot.

I wanna to bold the part of text from the text string which is in one
cell,this is the string which is joined from different cells into one cell
by
using function "CONCATENATE".

Here is the formula to be used
=CONCATENATE("I have ",C42," Rs with me.")
result ;
I have 500 Rs with me.

I wanna to do "500" bold, is there any way for this.

Waiting for the reply,
Regards,



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default HOW TO FORMATE PART OF TEXT FROM TEXT STRING

You can only format part of the displayed text in a cell differently from
the rest when that text is **not** the result of a formula. You could do
what you want by using an event procedure (which will react to changing the
value in C42). Here is how to do this (if you will need to do this for more
than one cell, you will have to provide more details so the code can be
changed to account for that).

Right-click the tab on the worksheet where you have your current formula and
select View Code from the popup menu that appears. This will take you into
the Visual Basic editor and a code window for that particular worksheet will
already be open (displayed). Simply copy/paste the code below into that open
code window. Next, you have to change the "$A$1" in the FIRST line of the
code to the absolute address (that is, with the dollar signs) of the cell
where you want you text sentence to appear. That is it; you are done. Every
time you change the value in C42, the cell you specified (in place of my
example $A$1 address) will be updated with the number bolded (we can also
change its color, italicize it, underline it, etc. too if you wanted). Now,
when you return to the worksheet, nothing will have happened yet because the
code I gave you only works when C42's value is changed; so, to get things
started, type in a value into C42 (or, if C42 contains a formula, change one
of that formula's dependent cells so the value in C42 is forced to change)
and look at what is displayed in the cell you specified.

'********** START OF CODE **********
Private Sub Worksheet_Change(ByVal Target As Range)

Const CellWithText As String = "$A$1"

If Target.Address = "$C$42" Then
On Error GoTo Whoops
Application.EnableEvents = False
With Range(CellWithText)
.Value = "I have " & Target.Value & " Rs with me."
.Cells.Characters(8, Len(Target.Value)).Font.Bold = True
End With
End If

Whoops:
Application.EnableEvents = True
End Sub
'********** END OF CODE **********


Rick


"Vishal" wrote in message
...
Hi,
Thanks a lot in advance for your help which will help me a lot.

I wanna to bold the part of text from the text string which is in one
cell,this is the string which is joined from different cells into one cell
by
using function "CONCATENATE".

Here is the formula to be used
=CONCATENATE("I have ",C42," Rs with me.")
result ;
I have 500 Rs with me.

I wanna to do "500" bold, is there any way for this.

Waiting for the reply,
Regards,


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
Formula to return part of a text string luvthavodka Excel Discussion (Misc queries) 9 October 20th 08 05:27 PM
Extract part of a text string Martin B Excel Worksheet Functions 7 January 13th 08 04:36 PM
Omitting right part of text string klysell Excel Worksheet Functions 6 January 13th 08 12:59 PM
How do I extract part of a text string Brennan Excel Discussion (Misc queries) 2 November 28th 06 07:26 PM
removing part of text string to another cell jamie_k Excel Discussion (Misc queries) 2 July 24th 06 10:57 AM


All times are GMT +1. The time now is 01:57 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"