Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I want to write a macro by which I can search a value 'DataA' in my excel sheet and replace it by value 'DataB'. -- reena ------------------------------------------------------------------------ reena's Profile: http://www.excelforum.com/member.php...o&userid=30440 View this thread: http://www.excelforum.com/showthread...hreadid=534496 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Reena,
This is freshly recorded :) Sub Replace() Cells.Replace What:="DataA", Replacement:="DataB", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False End Sub Regards, Bondi |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Or, in fact, if you don't actually have a particular need for a macro to do
it then why not select the Edit Find... menu item to bring up the Find and Replace dialogue. I'm convinced that you've seen it a million times before, but you may still be surprised over how feature-rich it actually is (e.g., turn on the Advanced Mode by pressing the Options... button, and why not check out the Format search options as well). Not everything needs to be done programmatically :o) But if you want to, then by recording your actions as a macro naturally helps a lot while trying to figure out exactly what Excel objects to manipulate, and what params to use. Good luck Reena, /MP "Bondi" wrote: Hi Reena, This is freshly recorded :) Sub Replace() Cells.Replace What:="DataA", Replacement:="DataB", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False End Sub Regards, Bondi |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Use Find and Replace in Excel | Excel Discussion (Misc queries) | |||
Excel 97 Find and Replace | Excel Discussion (Misc queries) | |||
Find and replace in excel | Excel Discussion (Misc queries) | |||
find and replace - replace data in rows to separated by commas | Excel Worksheet Functions | |||
Excel Find and Replace | Excel Discussion (Misc queries) |