LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Bony_Pony
 
Posts: n/a
Default VB Find and Replace

Hi all,
If I record a macro that does a find / replace on a sheet
and then record another one that does a Find / Replace on
the entire workbook, they are identical!!

How can I code a Find / Replace statement that will
always perform on all sheets in my workbook?

e.g.
This is the one for the sheet:
Application.FindFormat.Clear
Application.ReplaceFormat.Clear
Cells.Replace What:="aaaa", Replacement:="bbbbb",
LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False,
SearchFormat:=False, _
ReplaceFormat:=False

..... and this is the one for the workbook:

Application.FindFormat.Clear
Application.ReplaceFormat.Clear
Cells.Replace What:="aaaa", Replacement:="bbbbb",
LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False,
SearchFormat:=False, _
ReplaceFormat:=False


The only way I can make it work, is to set the switch in
the Find / Replace Dialog box on the EDIT Menu bar.
Anyone know how to switch that on in the macro??

Thanks for any help ...

Best regards,
Robert

 
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 replace text or symbol with carriage return jo New Users to Excel 11 April 4th 23 10:41 AM
macro to Find Replace in Excel Nurddin Excel Discussion (Misc queries) 7 January 3rd 05 04:29 AM
Find & Replace results to display specified chosen fields samuel Excel Discussion (Misc queries) 1 December 28th 04 08:43 AM
How Can I find and replace symbols in excel data ( white square) alawhizkid Excel Discussion (Misc queries) 1 December 14th 04 10:44 PM
Find & Replace questions David Excel Worksheet Functions 1 November 2nd 04 06:41 PM


All times are GMT +1. The time now is 12:29 AM.

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"