VBA to choose cells to add and multiply then paste results into new row

ThePangloss

New Member
Joined
Jun 19, 2015
Messages
40
Hey so I'm trying to make something in VBA that would make you input current payment and additional monthly, as well as select a range of a column that consists of FX rates. Then enter in the current month and calculate the information up to then and post it in this kind of format. It's going to be used for the future so I imagine the next time it's updated would be Jul 16 so the person would just find the FX rates and put them in the sheet and have it be able to select all the new rates.
At the end it should take all the values it's calculated and paste them into the rows below, so do the same for every row and I imagine I could do just the formula for one row and then have it do Next.

It looks something like this:


[TABLE="width: 500"]
<tbody>[TR]
[TD]Month[/TD]
[TD]Paid Amount[/TD]
[TD]Theoretical[/TD]
[TD]US/Uk Conversion[/TD]
[TD]Additional Monthly[/TD]
[TD]Recieved[/TD]
[TD]Shortfall[/TD]
[TD]Cumulative Variance[/TD]
[/TR]
[TR]
[TD]Oct-14[/TD]
[TD]4421.25[/TD]
[TD]8669.76
[/TD]
[TD]1.60680[/TD]
[TD]1216.52[/TD]
[TD]8320.59[/TD]
[TD]349.17
[/TD]
[TD]-1612.30
[/TD]
[/TR]
[TR]
[TD]Nov-14
[/TD]
[TD]4421.25[/TD]
[TD]8669.76[/TD]
[TD]1.57695[/TD]
[TD]1216.52[/TD]
[TD]8188.62[/TD]
[TD]481.14[/TD]
[TD]-1131.17[/TD]
[/TR]
[TR]
[TD]Dec-14[/TD]
[TD]4421.25[/TD]
[TD]8669.76[/TD]
[TD]1.56315[/TD]
[TD]1216.52[/TD]
[TD]8128.60[/TD]
[TD]542.16[/TD]
[TD]-589.00[/TD]
[/TR]
[TR]
[TD]Jan-15[/TD]
[TD]4421.25[/TD]
[TD]8669.76[/TD]
[TD]1.51568[/TD]
[TD]1216.52[/TD]
[TD]7917.72[/TD]
[TD]752.04[/TD]
[TD]163.04[/TD]
[/TR]
[TR]
[TD]Feb-15[/TD]
[TD]4421.25[/TD]
[TD]8669.76[/TD]
[TD]1.53274[/TD]
[TD]1216.52[/TD]
[TD]7993.15[/TD]
[TD]676.61[/TD]
[TD]839.65[/TD]
[/TR]
</tbody>[/TABLE]


Recieved is Paid*FX for that month + additional monthly
Shortfall is Theoretical - (Paid*FX for that month) - Additional Monthly
Cumulative variance is just the shortfalls added to each other from the previous shortfall.
I'm not exactly sure how to do this but I would guess it involves using Dim for 7 variables. Three of them would be as long, which are the additional monthly, theoertical and the actual payment. One as range which would be the set of the current FX rates up to whatever the current date is. Recived, Shortfall, and Cumulative shortfall would be as variable. I don't know how to put input boxes to enter information so I'm quite stumped on that part.

I'd prefer to do this than use formulas because there are multiple sheets like this, and it gets really annoying after a while. Some sheets are organized differently, or have extra columns with more payments and more FX changes, so if I have a general code for this I feel like modifying it would make this a lot easier.


Any help would be appreciated! Thanks
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Forum statistics

Threads
1,223,240
Messages
6,170,951
Members
452,368
Latest member
jayp2104

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