more specific help with code on edit/replace?

derickc

New Member
Joined
May 28, 2002
Messages
23
Ok, I've got a little code but I need a little help (I'm way rusty with VBA).

Here's what I've got:

Selection.Replace What:="ACAS", Replacement:="BFS"


I need the "BFS" to be dynamic such that the macro grabs the replacement from the header for each row. thank you!!

-dc
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Selection.Replace What:="ACAS", Replacement:=Range("A1").Value

... will move replace ACAS with the value in cell A1... are you looking for more than that?
 
Upvote 0
Jim,
Thanks for the reply. Here's what I need.

Range("D6:D1310").select
Selection.Replace What:="ACAS", Replacement:=Range("D5").Value
Range("E6:E1310").select
Selection.Replace What:="ACAS", Replacement:=Range("E5").Value
Range("F6:F1310").select
Selection.Replace What:="ACAS", Replacement:=Range("F5").Value

etc, through "EO6:EO1310". so I need the macro to step one column to the right and loop until it gets to column "EO".

I'm almost there, I can smell the finish line. Thanks again.

-dc
 
Upvote 0
Jim,
Thanks for the reply. Here's what I need.

Range("D6:D1310").select
Selection.Replace What:="ACAS", Replacement:=Range("D5").Value
Range("E6:E1310").select
Selection.Replace What:="ACAS", Replacement:=Range("E5").Value
Range("F6:F1310").select
Selection.Replace What:="ACAS", Replacement:=Range("F5").Value

etc, through "EO6:EO1310". so I need the macro to step one column to the right and loop until it gets to column "EO".

I'm almost there, I can smell the finish line. Thanks again.

-dc
 
Upvote 0
Jim,
Thanks for the reply. Here's what I need.

Range("D6:D1310").select
Selection.Replace What:="ACAS", Replacement:=Range("D5").Value
Range("E6:E1310").select
Selection.Replace What:="ACAS", Replacement:=Range("E5").Value
Range("F6:F1310").select
Selection.Replace What:="ACAS", Replacement:=Range("F5").Value

etc, through "EO6:EO1310". so I need the macro to step one column to the right and loop until it gets to column "EO".

I'm almost there, I can smell the finish line. Thanks again.

-dc
 
Upvote 0

Forum statistics

Threads
1,222,046
Messages
6,163,588
Members
451,846
Latest member
ajk99

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top