Auto number textbox value when worksheet is initialized.

Christiaan Viljoen

New Member
Joined
Oct 2, 2014
Messages
11
Hey guys.... I've got a userform 2 that is used to input values and data into a invoice that has been created on a worksheet named invoice. All data entered on this userform will also be saved on a worksheet named statements for filtering later on... What I need is the invoice number to be updated automatically when the userform is opened. I. Would like to retreive this number from the statements worksheet like column a will contain all invoice numbers in order. When a invoice is saved it needs to save it with the number in next open row and then retrieve that number 1 next time the userform opens. Hope it makes sense... Thanks a lot. I now realize I said worsheet on the title instead of userform. Sorry for that.
 
Last edited:
Sorry for being such a pain.... I renamed sheet6 to Statements.. And adjusted it in the coding to ("Statements")... It returns a value of 1 in the textbox... I have the following values on the statement sheet.... A1 is 1, A2 is 2, A3 is 3..... Now I need it to call the last number witch is 3 and add one. Then when I save( comand button) it need to save the 4 in A4 and next time call last value witch is 4 and add one. I'm making a invoice and statement database so if there is a better way to do it I'm open to any sugestions but keep in mind I'm new to this but I'm willing to learn.

Ps. Thank you for your pasience with me and pardon the. Spelling...
 
Last edited:
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
It sounds like column A contains text that looks like numbers rather than numbers. You can use Data|Text To Columns|Finish to convert them. When writing to the worksheet use the Val function, eg:

Code:
ActiveCell.Value = Val(TextBox1.Text)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,400
Messages
6,119,289
Members
448,885
Latest member
LokiSonic

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