Vba copy/paste and then calculate all formulas

phil133

Active Member
Joined
May 5, 2015
Messages
257
Office Version
  1. 365
Platform
  1. Windows
Hi. I'm trying to create a VBA. I would like to copy paste values Q6 to G6. Then, copy paste values Q6 to G7. Then, before moving to the next row to calculate all the formulas in this sheet. Then, copy paste values Q8 to G8. Then, copy paste values Q8 to G9. Then, again calculate all the formulas. Etc up to row 500.

If I just copy paste without recalculating the results will be wrong because eg. the value that Q8 will have will be affected by G6 and G7.

Thanks for any help!
 
Last edited:

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
You could try something like this:

Code:
Sub test()
'
' test Macro
'

'

    For i = 6 To 500
    Range("Q" & i).Copy
    Range("G" & i).PasteSpecial (xlPasteValues)
    Range("G" & i + 1).PasteSpecial (xlPasteValues)
    Range("Q" & i).Activate
    ActiveSheet.Calculate
    Next i
End Sub
 
Upvote 0
Thank you for that! But I don't want it for every row but for every other row. So I don't want to copy value Q7 to G7. How can I do that please?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,203,550
Messages
6,056,050
Members
444,841
Latest member
SF_Marnie

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