![]() |
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 |
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 |
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 |
All times are GMT +1. The time now is 05:33 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com