Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Find and replace thousand of cell values

Replace works on multiple cells. Why would you loop through every cell and
use the replace explicitly on each individual cell when you could do it one
time on the entire range? The inner loop is definitely an immense time
waster.


--
Regards,
Tom Ogilvy

"AA2e72E" wrote in message
...
Too quick to send!

Activae is also time consuming.

Try and adapt this, if appropriate:

Sub FindReplace(ByVal what, ByVal replacement)
Application.ScreenUpdating = False
For Each Sheet In ActiveWorkbook.Worksheets
For Each Cell In Sheet.UsedRange
Cell.Replace what:=what, replacement:=replacement,

LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Next
Next
Application.ScreenUpdating = True
End Sub

Sub aa()
FindReplace "Male", "THS IS A MALE"
End Sub



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Find and replace thousand of cell values

Somehow, I assumed that since the menu option cannot be used (that would work on multiple cells as you say), there was room for refining the find/replace process i.e if the cell has a formula, don't replace etc. That's why I said, 'adapt, if appropriate'
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
find and replace nonzero values with 1 Amylacc Excel Worksheet Functions 4 April 4th 23 10:53 AM
Find and Replace Cell Values Jeff Excel Discussion (Misc queries) 3 March 23rd 10 01:46 PM
Find and Replace Vs Update Values In DOUG ECKERT[_2_] Excel Worksheet Functions 0 March 3rd 08 03:29 PM
Find and Replace looking for values ArcticWolf Excel Discussion (Misc queries) 1 November 14th 07 12:42 PM
Find replace hyperion Values [email protected] Excel Discussion (Misc queries) 3 February 20th 07 05:37 PM


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