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

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
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,214,527
Messages
6,120,054
Members
448,940
Latest member
mdusw

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