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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

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
 

Forum statistics

Threads
1,148,056
Messages
5,744,548
Members
423,882
Latest member
Seeham

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