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
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