I really need help!

fatratstew

New Member
Joined
Feb 12, 2005
Messages
1
I am new to excel and am working on a project for my ICT A-level.
My workbook is for a hardware ordering company. There are 3 worksheets: Products, Profits and Customer. On the customer page is a userform in which the user enters the customer's details, the hardware they require and the quantitiy of each peice of hardware.
The details are then added to the Customer worksheet.
At the bottom of this page is a button and this is where i need help.

This is what I want the button to do:

1. Increase the numbers in "Amount purchased" column (in the Profits worksheet) by the quantity of each piece of hardware purchased. (eg. When the order contains 4 Intel Pentium Processors, I want to increase the cell in the "amount puchased" column by 4.)

2. Decrese the stock number for the items purchased in the Products worksheet by the quantity chosen.

3. Print an Invoice. (I will create an Invoice worksheet) and carry the information on the Customer worksheet over to that one in a presentable format.

4. If possible, clear all the fields in the customer worksheet and display a message box confirming the actions.

Could someone please help me with this?
I have little knowlege of VB so could you please explain it clearly.

Thankyou in advance. :)
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Welcome to the board. You havent advised what cells you want the values to go into or if theres any looping involved (ie for multiple cells) but maybe this will help...

Q1: Where A1 is the target cell, Userform1 is the name of your Userform and TextBox1 is the name of the box that holds the hardware amount...
Code:
Range("A1").Value = Userform1.TextBox1.Value + Range("A1").Value

Q2: Where B1 is the stock to decrease
Code:
Range("B1").Value = Range("B1").Value - Userform1.TextBox1.Value

Q3: You havent given enough detail. I would suggest recording a macro then seeing what the code has done. I presume your simply copying the results to somewhere else then printing or just printing an area.

Q4: Where A1:B1 are the cells to clear and "All Done" is the message. See MsgBox in VBA Help for all the options you can have such as the title and icons etc.
Code:
Range("A1:B1").ClearContents
MsgBox "All Done"
 
Upvote 0

Forum statistics

Threads
1,207,424
Messages
6,078,448
Members
446,339
Latest member
keogata

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top