Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35
Default REPLACE PART OF CELL WITH FORMATTED TEXT

DEAR ALL,
HOW DO I CHANGE PART OF CELL (TEXT IN NATURE) WITH FORMATTED TEXT?
EXAMPLE

A1=TRR/SM/HK

I WANT IT TO APPEAR LIKE TRR/SM/HK WITH SM IN BOLD AND ITALICS WITH
YELLOW HIGHLIGHTING

I TRIED DOING NORMAL REPLACE WITH FORMAT BUT THE WHOLE CELL CONTENT
CHANGED INTO BOLD AND ITALICS WITH HIGHLIGHT

THANKS

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 733
Default REPLACE PART OF CELL WITH FORMATTED TEXT

Manju wrote...
....
I WANT IT TO APPEAR LIKE TRR/SM/HK WITH SM IN BOLD AND ITALICS WITH
YELLOW HIGHLIGHTING

....

Don't use all caps. It's considered shouting.

You'd need to select the SM in the cell contents, press [Ctrl]+1, then
use the formatting dialog.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default REPLACE PART OF CELL WITH FORMATTED TEXT

If you want to do it manuallyselect cellgoto formula barselect the text
to changechange ittouch enter key

--
Don Guillett
SalesAid Software

"Manju" wrote in message
ps.com...
DEAR ALL,
HOW DO I CHANGE PART OF CELL (TEXT IN NATURE) WITH FORMATTED TEXT?
EXAMPLE

A1=TRR/SM/HK

I WANT IT TO APPEAR LIKE TRR/SM/HK WITH SM IN BOLD AND ITALICS WITH
YELLOW HIGHLIGHTING

I TRIED DOING NORMAL REPLACE WITH FORMAT BUT THE WHOLE CELL CONTENT
CHANGED INTO BOLD AND ITALICS WITH HIGHLIGHT

THANKS



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35
Default REPLACE PART OF CELL WITH FORMATTED TEXT


Harlan Grove wrote:
Manju wrote...
...
I WANT IT TO APPEAR LIKE TRR/SM/HK WITH SM IN BOLD AND ITALICS WITH
YELLOW HIGHLIGHTING

...

Don't use all caps. It's considered shouting.

You'd need to select the SM in the cell contents, press [Ctrl]+1, then
use the formatting dialog.


Sorry for using all caps.
I meant to change a vast range of cells which has other persons
initials also along with mine (SM) in a single cell to know all the
places where my name is appearing.
If i need to select each cell individually and change the formatting it
doesn't serve my purpose. I hope you have a solution.

How do I attach a excel file if I want to show you the actual
spreadsheet with problem ?
Regards.

Manju

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 733
Default REPLACE PART OF CELL WITH FORMATTED TEXT

Manju wrote...
....
I meant to change a vast range of cells which has other persons
initials also along with mine (SM) in a single cell to know all the
places where my name is appearing.
If i need to select each cell individually and change the formatting it
doesn't serve my purpose. I hope you have a solution.


The only way to make batch formatting changes to SUBSTRINGS of cell
contents is by macro. If you're willing to use macros, and if the
initials you want to change are SM always appearing between the first
and second instance of /, and if you preselect the cells involved, you
could use the following macro.

Sub foo()
Const INITIALS As String = "hg" & "/"

Dim c As Range, s As String, n As Long, p As Long

If Not TypeOf Selection Is Range Then Exit Sub

n = Len(INITIALS)

For Each c In Selection
s = c.Text
p = InStr(1, s, "/") + 1

If p 1 And Mid(s, p, n) = INITIALS Then
With c.Characters(p, n - 1)
.Font.Bold = True
.Font.Italic = True
.Font.ColorIndex = 5 'blue - change as needed

End With

End If

Next c

End Sub

How do I attach a excel file if I want to show you the actual
spreadsheet with problem ?


Don't. I don't open files from people I don't know, and anyone else
with any sense would also refuse to open your file. Plain text
descriptions are almost always sufficient.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35
Default REPLACE PART OF CELL WITH FORMATTED TEXT

No sir, the person who types the MOM doesn't follow a standard to write
the Persons responsible column in any particluar order and I cannot
insist him doing so. I now manually see whereever my initials appear,
and highlight the whole row for my reference.
Sorry the macro didn't work for my data is not in an order.
thanks for trying. Is there something else, i can try however crude
that will be
regards,



Harlan Grove wrote:
Manju wrote...
...
I meant to change a vast range of cells which has other persons
initials also along with mine (SM) in a single cell to know all the
places where my name is appearing.
If i need to select each cell individually and change the formatting it
doesn't serve my purpose. I hope you have a solution.


The only way to make batch formatting changes to SUBSTRINGS of cell
contents is by macro. If you're willing to use macros, and if the
initials you want to change are SM always appearing between the first
and second instance of /, and if you preselect the cells involved, you
could use the following macro.

Sub foo()
Const INITIALS As String = "hg" & "/"

Dim c As Range, s As String, n As Long, p As Long

If Not TypeOf Selection Is Range Then Exit Sub

n = Len(INITIALS)

For Each c In Selection
s = c.Text
p = InStr(1, s, "/") + 1

If p 1 And Mid(s, p, n) = INITIALS Then
With c.Characters(p, n - 1)
.Font.Bold = True
.Font.Italic = True
.Font.ColorIndex = 5 'blue - change as needed

End With

End If

Next c

End Sub

How do I attach a excel file if I want to show you the actual
spreadsheet with problem ?


Don't. I don't open files from people I don't know, and anyone else
with any sense would also refuse to open your file. Plain text
descriptions are almost always sufficient.


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default REPLACE PART OF CELL WITH FORMATTED TEXT

This may come close.

Sub Bold_String()
Dim rng As Range
Dim cell As Range
Dim start_str As Integer
Set rng = Selection
For Each cell In rng
start_str = InStr(cell.Value, "SM")
If start_str Then
With cell.Characters(start_str, 2).Font
.FontStyle = "Bold Italic"
.ColorIndex = 6
End With
End If
Next
End Sub


Gord Dibben MS Excel MVP

On 27 Dec 2006 12:41:50 -0800, "Manju" wrote:


Harlan Grove wrote:
Manju wrote...
...
I WANT IT TO APPEAR LIKE TRR/SM/HK WITH SM IN BOLD AND ITALICS WITH
YELLOW HIGHLIGHTING

...

Don't use all caps. It's considered shouting.

You'd need to select the SM in the cell contents, press [Ctrl]+1, then
use the formatting dialog.


Sorry for using all caps.
I meant to change a vast range of cells which has other persons
initials also along with mine (SM) in a single cell to know all the
places where my name is appearing.
If i need to select each cell individually and change the formatting it
doesn't serve my purpose. I hope you have a solution.

How do I attach a excel file if I want to show you the actual
spreadsheet with problem ?
Regards.

Manju


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 733
Default REPLACE PART OF CELL WITH FORMATTED TEXT

Gord Dibben wrote...
This may come close.

....

or not

start_str = InStr(cell.Value, "SM")
If start_str Then

....

This will format all instances of the substrings "SM", "Sm", "sM" and
"sm" under default settings, including substrings that are parts of
longer words, e.g., some other person with initials SMR would have the
"SM" formatted.

In order to automate this in a way that doesn't cause more problems
than it solves, the initials sought must appear as separate tokens,
i.e., with nonalphanumeric characters (or beginning or end of line)
delimiting them.

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default REPLACE PART OF CELL WITH FORMATTED TEXT

How about?
start_str = InStr(cell.Value, "SM")

start_str = InStr(cell.Value, "/SM/")
Then adjust the characters statement.

Sub Bold_String()
Dim rng As Range
Dim cell As Range
Dim start_str As Integer
Set rng = Selection
For Each cell In rng
start_str = InStr(cell.Value, "/SM/")
If start_str Then
With cell.Characters(start_str+1, 2).Font
.FontStyle = "Bold Italic"
.ColorIndex = 6
End With
End If
Next
End Sub

--
Don Guillett
SalesAid Software

"Harlan Grove" wrote in message
ps.com...
Gord Dibben wrote...
This may come close.

...

or not

start_str = InStr(cell.Value, "SM")
If start_str Then

...

This will format all instances of the substrings "SM", "Sm", "sM" and
"sm" under default settings, including substrings that are parts of
longer words, e.g., some other person with initials SMR would have the
"SM" formatted.

In order to automate this in a way that doesn't cause more problems
than it solves, the initials sought must appear as separate tokens,
i.e., with nonalphanumeric characters (or beginning or end of line)
delimiting them.



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
Copy from a Cell to a text box. AJL Excel Worksheet Functions 9 November 7th 06 04:58 PM
The number in this cell is formatted as text or preceded by an apostrophe" problem in Excel [email protected] Excel Discussion (Misc queries) 2 July 13th 06 01:55 PM
Cell Capacity - text i2meek Excel Discussion (Misc queries) 4 March 13th 06 12:06 AM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
Append Text to Cell Values Using Replace Ngan Excel Discussion (Misc queries) 4 June 4th 05 08:30 PM


All times are GMT +1. The time now is 10:03 PM.

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

About Us

"It's about Microsoft Excel"