Macro to loop and copy

phil133

Active Member
Joined
May 5, 2015
Messages
257
Office Version
  1. 365
Platform
  1. Windows
Hi. I'm looking for a macro that does the following: In sheet2 , F2 to take values from 336 to 369.6 every 2% and each time it takes a value to copy B11 of sheet2 to sheet3 at cell A4.
For example, put 336 to F2 and B11 becomes 6827. Copy to A4 of sheet3 6827.
Then, put 342.72 (336*1.02) to F2 and B11 becomes 7129. Copy to A5 of sheet3 7129.

Thanks for any help!
 
I found the answer in another forum
Code:
Sub x()


Dim d As Double, r As Long


With Sheet2
    d = 336: r = 4
    Do While d <= 369.6
        .Range("F2").Value = d
        Sheet3.Cells(r, 1).Value = .Range("B11").Value
        d = d * 1.02: r = r + 1
    Loop
End With


End Sub
 
Upvote 0
I found the answer in another forum
Thanks for letting up know that you solved it and for posting your solution.

I am not sure if you got your answer by posting your question in another forum, or by finding a similar question that you were able to modify. If you are posting your questions in other forums too, please be aware of our policy on Cross-Posting (see rule #13 here: http://www.mrexcel.com/forum/board-announcements/99490-forum-rules.html).

In a nutshell, we allow Cross-Posting, but just ask that you let others know that you are doing and posts links to the other posts you have made (so others can see what may have already been done on that question).

Thanks
 
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