how can I take a number from one cell and add it to a number from another cell and keep the answer in the same cell
THANKS RICHARD!
how can I take a number from one cell and add it to a number from another cell and keep the answer in the same cell
THANKS RICHARD!
Last edited by JimLau; 09-28-2012 at 02:00 AM.
You are describing an accumulator. Say you enter 4 in A1 and A2 becomes 4. If you now enter 7 in A1, A2 becomes 11. If you then enter 9 in A1, A2 becomes 20.
You can set this up with a macro.
Is this what you want?
Gary's Student
Yes this is exactly what I want with a twist. Not only do I need to update the number but I have to find the Part in goes to on the same row. there are 32 parts in that column. So I have to find it first the update it.
Hi,
I find it difficult to visualise what you describe. Can you give some specific examples please?
Richard Buttrey
RIP - d. 06/10/2022
If any of the responses have helped then please consider rating them by clicking the small star icon below the post.
Sorry Richard:
One other thing, if this is done in a macro. Can the macro run when they hit the enter key after they put the number in the cell.
Hi,
Yes, you'd use a Sheet_Change macro to update the relevant line that contains the Quantity.
I suggest that you add a third helper cell which uses an =MATCH() function to identify which row of your table contains the Part # you enter (either directly or via a drop down containing all part numbers) and then use that helper cell in the macro.
Untested since I don't have direct access to Excel at the moment - but assuming the part numbers are all in column A, with quantities in Column B, the part number in say D1 and the Quantity to adjust in E1, with a helper cell in F1 which contains the function
Formula:
=MATCH(D1,A:A,False)
Name the helper cell say "UpdateRow"
Now the macro would be
Sub Worksheet_Change(ByVal Target As Range) If Not Intersect (Target, Range("E1")) Is Nothing Then Range("B" & Range("UpdateRow"))=Range("B" & Range("UpdateRow"))+Range("E1") End If End Sub
Hi,
You would need to use a macro. Something like
Range("A2") = Range("A2")+Range("A1")
I have an Inventory file and of to the side of the table I have two cells one for the part# and one for the amount the user will adjust their inventory by. They can't go to the Qt. cell because it is update by another function. So I need to find the Part # in one column and then update the Qt. in another column on the same row. Am I sounding nuts!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks