Macro to find and replace whole data with values in another spreadsheet?

J

John

Hello.

I currently have a Macro which replaces numbers in all cells in column
A from row 3 onwards with different numbers.

I would like to change the Macro so that instead of having all the
replacements within the macro itself, it instead takes them from
another Spreadsheet called numberchanges.xls on drive C.

I need a little help with making this Macro though as I'm not an
expert with this sort of stuff.

Below shows three lines of the present Macro and the replacements it
makes:

Columns(1).Replace What:="1143", Replacement:="7945",
LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False

Columns(1).Replace What:="6762", Replacement:="4760",
LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False

Columns(1).Replace What:="70775", Replacement:="90001",
LookAt:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False

In the numberchanges.xls file I have this information in columns A and
B from row 3 onwards.

So 1143 is in cell A3 and it's replacement 7945 is in cell B3 and so
on until the last value.

How would I go about making the macro so that it opens the
numberchanges file and makes the replacements in the current document?

Cheers for any help

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top