I need to write a macro so that if a sales person from our company selects a given quantity of a specific item it will prompt a question that has a yes or no asnwer. if yes then it will need to add quantities for other items. for example, if they put qty = 1 for item "ZZ" , it will ask if they would like "q" and "x" as well, if yes it should put qty "1" next to those items in the sheet. I have never made macros and need help badly.
loop?
Collapse
X
-
To do the loop, something like this will doOriginally posted by metric6I need to write a macro so that if a sales person from our company selects a given quantity of a specific item it will prompt a question that has a yes or no asnwer. if yes then it will need to add quantities for other items. for example, if they put qty = 1 for item "ZZ" , it will ask if they would like "q" and "x" as well, if yes it should put qty "1" next to those items in the sheet. I have never made macros and need help badly.
[CODE=vb]
Do
if msgbox ("do you want to...¿?", vbyesno) = vbno then exit do
'the code for adding things
loop[/CODE]
The code for adding things would require for you to read some tutorials about VBA (visual basic for applications). Put special attention in the objects: CELLS RANGE WORKSHEETS WORKBOOKS and its properties, such as VALUE.
If you have then some specific doubts, we'll be glad to help you.
Comment