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

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
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
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,399
Members
448,957
Latest member
Hat4Life

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