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

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Jim North

MrExcel MVP
Joined
Jun 20, 2002
Messages
791
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?
 

derickc

New Member
Joined
May 28, 2002
Messages
23
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
 

derickc

New Member
Joined
May 28, 2002
Messages
23
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
 

derickc

New Member
Joined
May 28, 2002
Messages
23
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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,115
Messages
5,768,202
Members
425,459
Latest member
Danniey

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
Top