Reducing a list of numbers cleanly

cb123

New Member
Joined
Jul 1, 2016
Messages
34
Hi there,

Hoping someone can help me out, if you can many thanks in advance!

As an example i have a limited edition range of shoes, i can select the number of the range from a data validation list in cell A1. For this example i have set this pair of shoes to have a limited edition of 100 units. Is it possible to enter an amount of shoes i'm making into cell B1 and each time i do that it reduces my available limited edition amount?

A1 = shoes 100 from drop down list
B1 = I enter 10, press enter and the box clears for re-use but minuses the 10 from 100
C1 = summed to start with chosen A1 range then remove all entries in B1 (So currently would be 90)
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
10,306
I'm not sure if I understood correctly but try this: Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Enter a value in B1 and press the RETURN key.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.CountLarge > 1 Then Exit Sub
    Application.EnableEvents = False
    If Target.Address(0, 0) = "B1" Then
        Range("AA1") = Target
        Target.Offset(, 1) = Target.Offset(, -1) - Range("AA1")
        Target.ClearContents
        Range("AA1").ClearContents
    End If
    Application.EnableEvents = True
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,129,685
Messages
5,637,808
Members
416,983
Latest member
LessThanAverageUser

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
Top