Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find and Replace - based on font


I would like to code a macro such a way that it searches the specifie
cherecters say "yU" (without quats case sensitive) in whole or part o
a cell and replace it with the given cherecters.

Find :
&K}
font is Punjabi
case sensitive
whole or part of cell

Replace :
yU
Font wingdings
case sensitive
size same as previous.

It should be replaced only if all the above conditions (Find) are me
with.
Find string can be any combinations of english cherecters availabl
directly on the keyboard including special cherecters.
May be one of the experts or Gurus here can show me a way.

This is basically a mapping for a local language from english.
Thanks.
Rain

--
Rain
-----------------------------------------------------------------------
Raina's Profile: http://www.excelforum.com/member.php...fo&userid=1550
View this thread: http://www.excelforum.com/showthread.php?threadid=27075

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Find and Replace - based on font

Have you tried turning on the macro recorder and doing it manually? This
might be the easiest. (Edit=Replace) (macro recorder:
Tools=Macro=Record a new macro). Then turn off the macro recorder and
look at the recorded code. You can then make substitutions as appropriate.

--
Regards,
Tom Ogilvy

"Raina" wrote in message
...

I would like to code a macro such a way that it searches the specified
cherecters say "yU" (without quats case sensitive) in whole or part of
a cell and replace it with the given cherecters.

Find :
&K}
font is Punjabi
case sensitive
whole or part of cell

Replace :
yU
Font wingdings
case sensitive
size same as previous.

It should be replaced only if all the above conditions (Find) are met
with.
Find string can be any combinations of english cherecters available
directly on the keyboard including special cherecters.
May be one of the experts or Gurus here can show me a way.

This is basically a mapping for a local language from english.
Thanks.
Raina


--
Raina
------------------------------------------------------------------------
Raina's Profile:

http://www.excelforum.com/member.php...o&userid=15502
View this thread: http://www.excelforum.com/showthread...hreadid=270759



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 212
Default Find and Replace - based on font

Try this:

Sharad

Sub punjabi()

With Worksheets(1).Range("a1:f50") 'set your correct range here.
Set c = .Find("&K}", LookIn:=xlValues, Lookat:=xlPart, MatchCase:=True)
If c Is Nothing Then MsgBox "Hi"
If Not c Is Nothing Then
firstAddress = c.Address
Do
If c.Font.Name Like "Punjabi" Then
y = c.Replace("&K}", "yU", Lookat:=xlPart, MatchCase:=True)
c.Font.Name = "Wingdings"
End If
Set c = .FindNext(c)
Loop While Not (c Is Nothing) And (c.Address < firstAddress)
End If
End With

End Sub

"Raina" wrote in message
...

I would like to code a macro such a way that it searches the specified
cherecters say "yU" (without quats case sensitive) in whole or part of
a cell and replace it with the given cherecters.

Find :
&K}
font is Punjabi
case sensitive
whole or part of cell

Replace :
yU
Font wingdings
case sensitive
size same as previous.

It should be replaced only if all the above conditions (Find) are met
with.
Find string can be any combinations of english cherecters available
directly on the keyboard including special cherecters.
May be one of the experts or Gurus here can show me a way.

This is basically a mapping for a local language from english.
Thanks.
Raina


--
Raina
------------------------------------------------------------------------
Raina's Profile:
http://www.excelforum.com/member.php...o&userid=15502
View this thread: http://www.excelforum.com/showthread...hreadid=270759



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
how to find and replace content of a specific cell based on its ad IVUSKA Excel Discussion (Misc queries) 4 November 5th 08 03:13 PM
Find and Replace based on neighboring cells? djc Excel Discussion (Misc queries) 4 December 5th 07 03:18 PM
Quickest way to find/replace based on values? Cecilia Excel Worksheet Functions 1 February 22nd 07 05:29 PM
Find and Replace without changing font Tony Logan Excel Discussion (Misc queries) 4 December 11th 06 03:02 PM
Find and replace of word causes change of font formatting jwa90010 New Users to Excel 4 July 22nd 05 08:10 PM


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