Change formula macro

sirohiv

New Member
Joined
Jun 15, 2011
Messages
1
This one is tricky,

Each time I copy selected ROW.
I have to change this formula in various columns of row no. 259
=BDP($D$259,"interval_aVG","calc interval=30D","market data override=px_volume",G$204)
to
=BDP($D$270,"interval_aVG","calc interval=30D","market data override=px_volume",G$204)
for columns in row no. 270 and so on for other rows I copy the same formula.

This formula is used in column G,I,K (every alternate one) till column AA
Just to save the effort, I'm trying to figure out the macros I can use.


So far,

Sub copy()

Selection.copy
Range("A1000").End(xlUp).Offset(1, 0).Select
Selection.PasteSpecial (xlPasteAll)


End Sub

This one doesn't work for absolute ref. $D$270. This value has to remain absolute. So, I can't change it to D270. Need a macro. <!-- / message --><!-- BEGIN TEMPLATE: ad_showthread_firstpost_sig --><!-- END TEMPLATE: ad_showthread_firstpost_sig -->
 
Welcome to the board sirohiv,

If I am understanding you requirements correctly I don't think you will need a macro to do this. You can use replace as it seems you just want to change the reference from $D$259 to $D$270

  • Select the cells/row you want to change
  • Open Find and Replace (ctrl+h).
  • Find what: $D$259
  • Replace with: $D$270
  • Press the Option >> button
  • Look in: Formulas

You can change all if you know it won't be a problem with Replace All or walk through it with Replace and Find Next (to skip).
 
Upvote 0
Perhaps you just need relative addressing. Try putting this in row 259. (note the $D259
=BDP($D259,"interval_aVG","calc interval=30D","market data override=px_volume",$G$204)

and then just drag downward, or copy/paste, or use FillDown.
 
Upvote 0

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