Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
OVJ OVJ is offline
external usenet poster
 
Posts: 1
Default Search & Replace

I want to do a search and replace using info in cells on a work sheet. For
example, the search item in cell A1, the replace item in B1. Is there any way
to do this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Search & Replace


Using a macro like the following:


Code:
--------------------


Sub OVJ()
Range("A2:Z20").Replace What:=Range("A1").Value, Replacement:=Range("B1").Value, _
LookAt:=xlWhole, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub
--------------------


--
Paul

- Paul
------------------------------------------------------------------------
Paul's Profile: 1697
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=192381

http://www.thecodecage.com/forumz

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Search & Replace

Sub find_replace()
Dim whatis As String
Dim withwhat As String
whatis = Range("A1").Value
withwhat = Range("B1").Value
Range("A2:F62").Select
Selection.Replace what:=whatis, Replacement:=withwhat, LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A1").Select
End Sub


Gord Dibben MS Excel MVP


On Thu, 1 Apr 2010 14:36:01 -0700, OVJ
wrote:

I want to do a search and replace using info in cells on a work sheet. For
example, the search item in cell A1, the replace item in B1. Is there any way
to do this?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Search & Replace

Is it one find and replace or are there multiple criteria?

"OVJ" wrote:

I want to do a search and replace using info in cells on a work sheet. For
example, the search item in cell A1, the replace item in B1. Is there any way
to do this?

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
Search and replace CatPEG Excel Discussion (Misc queries) 4 January 7th 08 04:31 AM
Search and Replace LymaBeane Excel Worksheet Functions 2 September 13th 06 10:30 PM
Search and Replace Abdul Excel Discussion (Misc queries) 2 March 23rd 06 02:38 PM
search & replace joe_may Excel Worksheet Functions 1 November 8th 04 11:16 PM
Search and replace rajgopal Excel Programming 1 October 1st 04 07:17 PM


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