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 in excel


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Find and replace in excel

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 97
Default Find and replace in excel

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
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
Use Find and Replace in Excel tenspeed2 Excel Discussion (Misc queries) 1 May 5th 10 05:31 PM
Excel 97 Find and Replace [email protected] Excel Discussion (Misc queries) 1 December 27th 07 05:58 PM
Find and replace in excel ChrisB Excel Discussion (Misc queries) 4 January 17th 07 08:34 PM
find and replace - replace data in rows to separated by commas msdker Excel Worksheet Functions 1 April 15th 06 01:00 AM
Excel Find and Replace Donna Excel Discussion (Misc queries) 1 December 1st 05 05:29 AM


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