LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   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.

 
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 05:14 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"