![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 122
|
I got a stock workbook with a list of product with the quantity of stock. when stock comes in i need to no a way of adding stock to each stock quantity for each item. drop down boxes - no way. i can get d input boxes to work but u need to no where to stop them. n it doesnt add the stock that has come in to the current stock automatically
PLZ HELP |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Posts: 122
|
PLZ REPLY
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Location: Chippenham, UK
Posts: 136
|
Do you have stock id numbers/codes in one column and then the amount of stock in another column?
Are the stock codes/numbers unique?
__________________
Regards, Gary Hewitt-Long |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Posts: 122
|
YEAH I DO!!!! and......... plz help.
e.g. Product ID Quantity FF01 2 |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Mar 2002
Posts: 122
|
........... :|
|
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Feb 2002
Location: Chippenham, UK
Posts: 136
|
Use this as a starting point
Private Sub CommandButton1_Click() Cells.Find(What:=TextBox1.Value, After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ True).Activate ActiveCell.Offset(ColumnOffset:=1).Activate ActiveCell.Formula = ActiveCell.Value + TextBox2.Value End Sub If I were you I would use a user Form. You will need at least two textboxes, one for the ID and one for the amount to add. I haven't done it hear, but you could also add option buttons so that depending on the selection it will either: add subtract Overwrite to current value. You also need to write in error handling in case it can't find the stock item. I wrote a similar thing for a warehouse so as stores personal could look for stock on pallets. I had to include in the application that added new stock to always convert text to uppercase. The reason for this is I also used UPPER in the userform so it is then possible to use match case.
__________________
Regards, Gary Hewitt-Long |
|
|
|
|
|
#7 |
|
Board Regular
Join Date: Mar 2002
Posts: 122
|
THANKS A LOT. ill try this 2morrow bcos im workin on it then. Ive seen some1 make a user form but it looks really hard. anyway ill have a go! if i have problems ill write bak. also is there a way of adding stock into the user form and this is added to the stock ur adding to. This is bcos the new quantitys entered will b comeing from a delivery note so it would be easier to enter the quantity on the delivery and excel adds it automatically. do u no how to do this?
thanks again. |
|
|
|
|
|
#8 |
|
Board Regular
Join Date: Mar 2002
Posts: 122
|
(Y)
|
|
|
|
|
|
#9 |
|
Board Regular
Join Date: Mar 2002
Posts: 122
|
hey where do i enter this code. do i make the user form first???
|
|
|
|
|
|
#10 |
|
Board Regular
Join Date: Mar 2002
Posts: 122
|
hey ive created the user form with 2 lables Product ID
Quantity with corresponding txt boxes. Ive also created a comand button "Enter" How do i make these things work???? ive pasted that code in where it should go i think? do i change the properities thingy? |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|