Add / Subtract From Total With Userform
Feb 16, 2014
Is it possible to add to or subtract from the value of a cell with a macro? For example, lets I have a cell that contains the number of nails in a drawer (200) and I needed to remove one. I enter the number 1 in a cell and hit the remove button. The cell that contains the value of total nails would then be one less (ie: 200-1=199).
If I used a user form for something like this what would the vba look like?
Also, I realize that this would probably be easier with Access however, I do not know Access very well at all and the number of items I have to do this with would not warrant a database.
View 2 Replies
ADVERTISEMENT
Feb 20, 2010
CELL A1=45
I want CELL A2 to be a blank cell which people can enter a number in that will decrease the value of A1 and once that value is entered, it would return to a blank cell. CELL A3 would be used in the same fashion except to increase the value of A1
what would a formula for this look like?
View 10 Replies
View Related
Aug 24, 2014
In cell A1 i have a total amount, lets say it's 20, in B1 i have a value of 5, in C1 i have 10.
Looking to see if it's possible to take the 5 from cell B1 to make A1 = 15, then 10 from cell C1 to make it 5 in A1 whilst reducing both columns B and C to zero If B1 or C1 are greater than the value in A1, A1 displays that amount that would be left
only thing i can think of is a hidden column to calculate whilst incorporating an if statement into B & C?
View 1 Replies
View Related
Jan 9, 2014
for example:
Period Revenue 5% 10% 15% 20% -5% -10% -15% -20%
$72,003.33 $75,603.50 $79,203.67 $82,803.83 $86,404.00 $68,403.17
View 1 Replies
View Related
Jun 29, 2006
would like a very small macro for the following:
Units units remain day 1 day 2 day 3 ... day 13
MACRO
The units are the total number of units that can be bought ( in a game) and these are purchased on a daily basis.
I would like a column " units remain" as units are purchased to just count down auotomatically as numbers are entered into the daily row.
Thus:
11 xx day 1 day 2
Where xx would chage as numbers are entered into day 1-13 ( these will be either 1 or 2).
View 4 Replies
View Related
Apr 10, 2014
I am creating a spreadsheet for inventory use. I want to have a running total in (1) cell based upon a new/different number being entered into a different cell.
Column B, Row 1 (This will be a new/different number entered every day - inventory in or out, so positive or negative number)
Column D, Row 1 (This will be a running total based on numbers inserted in previous 2 columns)
Basically what I have is a key inventory. So there is column A with key number, B should be keys IN, C should be keys OUT, or ideally B would be IN and OUT meaning, for inventory IN input a positive number and for inventory OUT input a negative number, and D Should be total.
Column E represents number of keys currently in the inventory. I was going to hide the current inventory column so all you see is IN/OUT and total. So what I need is to be able to just come in and type in a number in the IN and/or OUT column, without having to add/subtract it with the number already in that column.
Bottom line, I'd like to be able to use IN and/or OUT columns to just type in numbers as they come and not have to worry about what's already in those columns and get correct total number.
Ok here it is. Attached worksheet shows
Column A - Key Numbers...No data value
Column B - Inventory IN
Column C - Inventory OUT
Column D - Total
Column E - Current Inventory(Starting point)
So the formula I used to get what i currently have is (=B2-C2+E2). This way whatever i input in columns C and C. totals out in D. But this way every time I want to add/subtract a number in B and C, i have to add to the number already in the column. I'd like to be able to type in a number in B and C as i go and still have a correct total. I wouldn't mind having just one column for in/out and use positive and negative numbers to differentiate inventory in or out.
View 2 Replies
View Related
May 30, 2014
EX:
1200
1205
1210
1215
Cell with total should contain 15
These are mileage numbers. At the end I need to know the total miles driven as miles are added. I need to be able to see the total miles driven as mileage is added. At the end of the week, I need to see total miles driven.
View 7 Replies
View Related
Dec 7, 2011
I have several columns of sub-total and total as shown in the screen print. I need some code that will allow me to take the value of total and subtract it from sub-total. The number of rows changes weekly so I cannot simply state =f10-f11
I thought xlup and offsetting would be a good way to do it, but I'd still need to assign a cell number.
View 1 Replies
View Related
Sep 25, 2009
I have 2 tables, one with invoices, the other with purchase orders. I would like to have a "PO Amount Remaining" column on the invoice table that looks up the PO listed on the invoice with the PO $ amount on the PO table. Once it is matched, I would like to subtract the total invoices to give me the amount of the PO that is left. Basically I would like the "PO Amount Remaining" column right now to have $4,200 listed in each row for invoices 1 & 2.....
View 18 Replies
View Related
Oct 13, 2007
How can I work out the following in hours an minutes: -
Cell A1 = 12th May 2007 20:00
Cell B1 - 14th May 2007 14:30
or should I put the dates and times in seperate cells? I would like the answer to show 42 hours 30 minutes
View 3 Replies
View Related
Sep 1, 2011
'Pivot Table Calculated Fields" - Below is my pivot table.
I need the pivot table to subtract 'February' sales figures from 'January' sales figures to get the difference (variance).
I know the following steps:
1) Click on the Pivot Table
2) Choose "Formulas"
3) Choose "Calculated Field"
4) In the "Name" field - type in the name that I want "Two Month Variance" (for example)
5)......then I don't know what to do
Sum of Quantitymonthsupplier idjanfebGrand Total
754466163150842519337568263901785022875682639410025035075682639500
75682639642523866375682639780012492049756826398209209756826399292292
756826400264264756826401178178757494037292292761034919209209867233456264264(blank)
Grand Total245154236931
View 9 Replies
View Related
Aug 16, 2014
I'm currently working on the database for use at work and i would like to improve the code below with couple more functions in my userform.
This code is triggered after i put any value in the textbox then it looks for part number in the "Update" tab and counts how many times this part number appears in column ("Q2:Q") and then depending on count result it shows nothing or "No Sample" in the "Skip" label.
I would like to add some improvements to this code and here comes complicated part:
After i will input any value into the textbox the code should:
1. go to "Database" tab and sum all majors and minors for this part number; Part numbers are listed in the "Database" tab column "F2:F", Majors in column "P2:P", Minors in column "O2:O". Majors and minors are numbers.
2. if this part number has no majors or minors (basically if all cells in column P and O are blank for this part number) proceed with the code below otherwise substract (-) the sum of majors and minors from the count result in the "Update" tab.
For example part number "PN1234567" has been booked 10 times(counts in the Update tab column Q) and we summed 3 majors and no minors for this part number (summing in Database tab columns P and O) it should look like this : 10-3=7, basically we need to do this simple calculation. Of course if we will find more majors and minors then the bookings it should look like that: for example 15bookings-10majors-10minors = -5
3. and finally knowing the final result we can select the case as in the code below.
[Code] ......
Attached File : 16_08_2014 - Copy.zip
View 8 Replies
View Related
Feb 27, 2013
formula which uses 4 cells
the 4 cells are
Cell B2 - this is a set figure which is the initial base figure - currently set to 43
Cell C2 - This subtracts Cell B2 figure (which is 43) from Cell E34 [=SUM(B2-E34)]
Cell E34 - Is a cumulative total of 4 cells [=SUM(E4,E12,E19,E26)] and displays the total.
Cell D2 is a set figure of 49
The formula I am looking for is once C2 reaches zero, I need C2 to remain displaying zero and the remaining figure to be deducted from D2 and displayed in that cell so C2 figure would descend from 43 until it reaches zero. but would then start decreasing D2 whilst C2 would remain static at zero and carry that the remaining figure to D2 which would be deducted from the starting total of 49 and display the figure.
View 5 Replies
View Related
Jul 21, 2006
I know this may have been answered before but I didn't really understand those answers and my scenario is slightly different. I have a UserForm that I am asking people to enter data into. One part of the UserForm asks for a percentage spread across an age range. For example for the age ranges 16-20, 21-25, 26-30 (etc) whats the percentage of smokers. This will obviously then add up to 100% which I want to put in a ' total' box at the end of the line of input boxes. I want this box to be updated whenever someone enters a percentage into the boxs but I can't seem to work out how to do it. That's basically what I'm asking help for on. Its easy enough when doing it on the spreadsheets themselves with the SUM function but how can I do it on a UserForm. Does it need some complex VB coding?
View 7 Replies
View Related
Apr 4, 2014
I have a UserForm which enables the user to input sales figures for each month for 5 years.
At the bottom of each year is the total box.
At the moment it only sums the 12 months when each month has a figure in it. Sometimes the user only needs to enter, lets say, 4 months figures and the total box doesn't work. It also doesn't sum as data is entered i.e. it only adds them up when all 12 months TextBoxes have a number in them.
Can I literally make it as simple as it would be on a normal worksheet i.e. =SUM(A1:A12) ??
Here is my code that is 'in' each month's TextBox
[Code] .....
End Sub
The total box itself - txtY1Total - doesn't have any code in it.
View 1 Replies
View Related
Jun 21, 2006
I am trying to get running totals in three TextBoxes on a UserForm. The UserForm is to enter one item from a receipt which can have many items. The running total is for the number of items on the receipt, amount of discounts (coupons), amount of sales tax and the grand total. A small sample is attached
View 4 Replies
View Related
Apr 28, 2012
I am trying to subtract an amount from a cell until it reaches 0, then move and subtract from the next amount, and so on.
AmountFixed BudgetedResult53.50Subtracted 5 tell it hit zero1.30Subtracted remaining amount until zero43.8Subtracted remaining amount until zero3.8 was left over without hitting zero is good. Is there formula for this?
View 6 Replies
View Related
Jan 7, 2010
I have a report which has a list of customers, each customer has 24 columns which represent the payment history over 24 months. If a payment has been made for that month the date and time (formatted correctly) will be populated in this cell.
Each customer has a product name attached to it so a product can appear several times. I need is a formula that shows the total payments recieved for a particular month for a particular product. For example.
I have managed to create the following flag which works a treat, it picks up a date an account was set up but looks at 1 column.
View 2 Replies
View Related
Apr 22, 2009
This may not be the best way to do this, but I don't know Macros or Pivot Tables.
I am looking for a way with formulas to do the following:
Within a workbook the 1st sheet is the data entry.
In another sheet that will total data from the data sheet is where I want to be able to total columns of data, depending on what is entered in one specific column:
Example:
Data Sheet, E2:E2999 is a unit number selcted by pull down tab entry.
G2:G2999 in the same sheet is where the data is.
Q: What formula would allow to total the data on the Total Sheet depending on what unit number is selected in column E on the Data Sheet and the data amount in column D from Data Sheet?
View 9 Replies
View Related
Mar 5, 2014
I need to set up an easy to use spread sheet for my office. It needs to be able to calculate the running total spent of fuel, as well as include any discounts we get and then calculate our total savings.So basically, total spent and total saved.
View 3 Replies
View Related
Dec 21, 2008
I'm sure this can be done but I don't think I have the formula correct. What I am trying to do is add each day's total while displaying a positive number if the total exceeds 6000.
View 5 Replies
View Related
Dec 13, 2013
number for item detail level from category standpoint. For example, in the category sheet has total number per category and per month and in the item detail sheet has a list of item number with category. I want a formula to recognize which item belongs to which category then use the total number of category by month to multiply with % of total in column D from Item Detail Spreadsheet.
View 2 Replies
View Related
Jun 13, 2014
I am trying to create a very basic workbook that has 2 worksheets. one is a daily input for tonnes, that then just gets cut and pasted to a different program, and the other worksheet is the running total. i.e., it adds up every time you update it.
been trying to figure out a macro so when you press the update button it then just updates the monthly total.
Colac Production.xls
View 7 Replies
View Related
Oct 10, 2009
In an excel work shift schedule, I am trying to total the total number of days someone is scheduled for different shifts. I can get a total for the current schedule but I want to be able to have a year to date total as each new schedule is added in. These totals are in the AF through BC columns in the xray shift totals in the attached worksheet.
I don't know if it is possible or not and am working on a pre-existing worksheet.
View 9 Replies
View Related
Sep 13, 2009
Sub sumbotton()
Dim ar As Range
Dim rng As Range
Set rng = Selection.CurrentRegion
Set rng = rng.Resize(rng.Rows.Count + 1)
rng.Rows(rng.Rows.Count).Select
For Each ar In rng.Areas
ar.Resize(1).Offset(ar.Rows.Count) = "=SUM(" & ar.Address & ")"
Next ar
End Sub
View 9 Replies
View Related
Oct 15, 2007
I have a sheet in my workbook with at least 180 small tables, there may be more.
I woulds like to be able to change total formulas for all tables at once to show either year-to- date or total year.
For example:
If we have only progressed through the second period of the year, I would like to choose something to indicate period 2. At other time I may want to know the total year whether the periods are completed or not.
View 9 Replies
View Related
Jun 9, 2014
I have a column with Cells that will sat True or False, the amount of rows will be different every time, I need to work out what the total percentage of True cells compared to the total number of cells. How would this be achieved.
View 9 Replies
View Related
Dec 28, 2013
I need a formula to do the following
Subtract I62 from I62 only if F62 contains P/UT and put answer of subtraction in L62.
Cells are in Time format
View 8 Replies
View Related
Jan 28, 2008
Firstly i am running Excel 2003 (at work)
Now my problem is that i have been asked to make a spreadsheet about Printer and Fax Cartridges (Zzzzz) but i do not know how to do the sum.
this is how my Spreadsheet looks like this (cartidge amount etc all on top line of spreadsheet)
(Hp45 etc all down left hand side) ...
View 9 Replies
View Related
Oct 24, 2008
Seems that when I subtract a future date from NOW() and format the cell d:hh:mm that the result is 1 day off. So if I subtract NOW() (today is 10/24) from 10/25/08 it returns a 1 for the d when I would expect it to be zero.
View 14 Replies
View Related