Forum Discussion
Interactive PURCHASE ORDER
Hello guys,
First of all, sorry for my English, I'll try to be as clear as I can. I'd like to create an excel file for my company but I don't know if it's possible.
The idea is pretty simple :
1- The Customer clicks on a product image, like a banana
2- the product is automatically written in the purchase order :
Then, if you click on another product (or the same one), it does exactly the same but on the line after.
3- if you click on the color column you can choose a few specific colors (not all of them).
4- the customers will write down the amount and lenght so I don't neet help on that one.
My question is : do you know how to do that ? Is it possible ? Can you explain me how to do it ?
Thanks a lot and have a wonderful day !!!
- JKPieterseSilver Contributor
1 and 2:
Click the banana image. In the name box (to the left of the formula bar) enter "Banana" (without the quotes) (do this for each image, using the appropriate fruit name)
Right-click the banana again and select Assign Macro. Enter "Add2Table" and press "New". The VBA editor opens with this text inside:
Sub Add2Table()
End Sub
replace that with:
Sub Add2Table() Range("A" & ActiveSheet.Rows.Count).End(xlUp).Offset(1).Value = Application.Caller End Sub
Note that this assumes your fruit names are in column A, adjust accordingly.
For the other images click them, assign macro, select "Add2Table" from the list in the dialog and click OK.
3: Enter your colors somewhere out of the way in rows. Click the Data tab and choose Data Validation. Select the List option in the Allow box. Click in the Source box, type the equal sign and select the cells with the colors you just entered. OK.
- Bacacier AuvergneCopper Contributor
Thank you very much for your time and your answer ! That works perfectly !!!
I have another question : if my image is on sheet 2 and my PURCHASE ORDER is on sheet 1, how can I click on the image and it does the same but in a different sheet ?
Thank you very much again !!!
- JKPieterseSilver Contributor
Suppose the sheet is called "Example":
Sub Add2Table() With Worksheets("Example") .Range("A" & .Rows.Count).End(xlUp).Offset(1).Value = Application.Caller End With End Sub
Note the period characters before "Range" and "Rows.Count", these are deliberate and make those items refer back to what is after the With statement: Worksheets("Example")