Macro to replace numbers in certain columns?

J

John

Hello.

I have a macro which replaces certain numbers entered in a spreadsheet
with different numbers. I only want it to do it for column A but at
the moment it does it for the whole spreadsheet. Do you know how I
can fix this?

This is an example of the macro. It changes 100 to 1000, 200 to 2000
etc.

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 10/12/2003 by John
'
' Keyboard Shortcut: Ctrl+k
'
Cells.Replace What:="100", Replacement:="1000", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Cells.Replace What:="200", Replacement:="2000", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Cells.Replace What:="300", Replacement:="3000", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
Cells.Replace What:="400", Replacement:="4000", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False
End Sub


Thanks 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