LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Search & Replace macro

Hi,

I cant find this anywhere so please excuse possible repeat....

I would like a macro which will search for the value of a cell (in one
worksheet) and simply replace a value in another worksheet with the value of
another. E.G. Search for contents of B30 and replace with contents of F30.
Simple i hear you say, but my current macro always contains the actual
value at time of recording so if i change the value of the cells, the macro
searches for and replaces the values previously stored and not the new values
i'm using.
Here is what i have...
Sheets("Summary").Select
Range("B30").Select
Selection.Copy
Range("F30").Select
Application.CutCopyMode = False
Selection.Copy
Cells.Replace What:="(nn)", Replacement:="20", LookAt:=xlPart,
SearchOrder _
:=xlByRows, MatchCase:=False, SearchFormat:=False,
ReplaceFormat:=False

I would like the values (nn) and 20 to be dynamic and always refer to what's
in the range("B30") and ("F30) rather than insert fixed values (taken at time
of recording).

Many thanks.
 
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
Macro Search and Replace [email protected] Excel Discussion (Misc queries) 2 September 23rd 08 01:13 PM
Variable in a Search and Replace macro Sandy Excel Programming 4 April 25th 05 07:35 PM
Macro to Search and Replace Excel_Rookie[_3_] Excel Programming 1 September 23rd 04 05:09 PM
SEARCH & REPLACE MACRO Josh[_11_] Excel Programming 2 August 4th 04 05:07 PM
Macro search replace question WDP[_2_] Excel Programming 1 August 28th 03 06:18 AM


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