Userform Question

healey21

Well-known Member
Joined
Dec 22, 2009
Messages
900
I am looking to use a Excel VBA UserForm and with the form I am adding a person name, a product they sell and date of sales.

What I am doing currently is using a worksheet for that person and then using cell A2 to hold the Product and cell D2 to hold the date of sale, and subsequent A3 for the next Product and D3 for the next sales date. I need the form to check the sheet name against the sales person and then go to A2 find the next empty row and add the product and sales date. Then check the Master sheet for the sales persons name and find the product and add the date.

what I then do on the Master sheet is to have all my sales people down column A and the sales products go across Row 1, what I would like to do is when using the form, Add the date to the master for the sale of the product when I am selecting to add a Sales person and Product.

My userForm has 3 options txtSales, cboProduct and txtSalesDate

On the Master Sheet All the products are listed across Row 1 and and sales persons name in Column A (starting in A2), I would like to capture the date of sales where it finds the sales person and product which has been selected.

The workbook currently has multiple sheets for each sales person and I would like to run a routine to go through each sheet, finding the sales person name and add the date for each product if possible. Each sheet is laid out the same and a sample is indicated below:

Sample of Sales Person worksheet

Excel Workbook
ABCD
1Sales Person NameGraham Smith
2ProductSales ValueAmount SoldDate of Sales
3Balls123201/02/2011
4Phones3412302/02/2011
5Chairs45530/03/2011
Graham Smith
Excel tables to the web >> http://www.excel-jeanie-html.de/index.php?f=1" target="_blank"> Excel Jeanie HTML 4


Sample of Master Sheet.

Excel Workbook
ABCDEFG
1BallsPhonesChairsKnifesInkStationery
2Sales Person
3Graham Smith
4Alan Brown
5Julie Jackson
Master
Excel tables to the web >> http://www.excel-jeanie-html.de/index.php?f=1" target="_blank"> Excel Jeanie HTML 4

Sample of Master sheet with dates shown for Products

Excel Workbook
ABCDEFG
1BallsPhonesChairsKnifesInkStationery
2Sales Person
3Graham Smith01/02/201102/02/201130/03/2011
4Alan Brown01/02/201102/02/201101/03/2011
5Julie Jackson01/02/201101/03/2011
602/02/2011
Master
 
Last edited:

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Hi Healey21

From your user form you can add a command button that will add the product and sales date to the sheet for the sales person. You can look to add a Do Until for this, take a look at this example below:

Range("A2").select
Do Until Activecell.value=""
activecell.offset(1,0).select
Loop
activecell.value=cboProduct.value
activecell.(offset,0,3).value=txtSalesDate.value

This should help with using the form, as I assume you will activate the sales person sheet when the form is initialized or activated.
 
Upvote 0
Thank you Trevor G,

I will look to test this and reply accordingly.

Can anyone help about the Summary option.
 
Upvote 0
I have used the code you suggested Trevor G and it works for the worksheet I work on for the sales person but now need to get it to check the Summary sheet and place the date in against the Product Sold any help will be wonderful, if someone can assist.
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,292
Members
452,902
Latest member
Knuddeluff

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