Macro to change amount of next bill and carry it forward

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
2,398
Hi Everyone,

Ok so a bit of a strange one i'm doing a Billing cycle that shows how much is owed but i need to be able to adjust the amounts and could do with a macro to help.

So I have three ranges we take to take into account.

AC10:AC26 is my indicator for what we are goig to change.
Z10:Z26 & AA10:AA26 are amounts

So heres what I need.

I will press a buton and run the macro,
the macro will ask me "What figure do you want to change the payment to?" and I can put any figure I like including zero and minus

The macro then adjusts the next amount due to the figure ive said and adds the difference on to the next months figure.

So heres it in English if code could read it lol.

I run Macro,
Message Box "What figure do you want to change the payment to?" and gives me a place it input my amount.
I put an amount for example 1000, it then looks at the sheet down
AC10:AC26 finds the first row to have "No" in that column goes to that row in AA changes the amount to what i said and adds the difference to whatever was in the row below it.

Hope that makes senc, please help if you can

Thanks

Tony
 

Some videos you may like

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
36,118
Office Version
365
Platform
Windows
How about
Code:
Sub tonywatson()
    Dim Fnd As Range
    Dim Inpt As Double, Dif As Double
    
    Inpt = Application.InputBox("Inptut an amount", , , , , , , 1)
    If Not Inpt = 0 Then
        Set Fnd = Range("AC10:AC26").Find("No", , , xlWhole, , , False, , False)
        If Not Fnd Is Nothing Then
            Dif = Fnd.Offset(, -2).Value - Inpt
            Fnd.Offset(, -2) = Inpt
            Fnd.Offset(1, -2) = Fnd.Offset(1, -2) + Dif
        End If
    End If
End Sub
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
36,118
Office Version
365
Platform
Windows
You're welcome & thanks for the feedback
 

Watch MrExcel Video

Forum statistics

Threads
1,090,426
Messages
5,414,412
Members
403,526
Latest member
swedeness50

This Week's Hot Topics

Top