Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, I have a user form to add jobs to my worksheet, each job has a job number which run in a list down the A column, the problem is you have to type the new job number in manual in the text box on the userform for ever new job.. Is the away to make it look down the list in column A for the last one and then +1 onto it and auto load it into the job textbox on my userform? Thanks Clare -- clarefoxly ------------------------------------------------------------------------ clarefoxly's Profile: http://www.excelforum.com/member.php...o&userid=24183 View this thread: http://www.excelforum.com/showthread...hreadid=384541 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try something like this...
txtMyTextbox.text = sheets("Sheet1").range("A65536").end(xlUp).value + 1 This assumes that you have numbers in column A. An error will be generated otherwise. -- HTH... Jim Thomlinson "clarefoxly" wrote: Hi, I have a user form to add jobs to my worksheet, each job has a job number which run in a list down the A column, the problem is you have to type the new job number in manual in the text box on the userform for ever new job.. Is the away to make it look down the list in column A for the last one and then +1 onto it and auto load it into the job textbox on my userform? Thanks Clare -- clarefoxly ------------------------------------------------------------------------ clarefoxly's Profile: http://www.excelforum.com/member.php...o&userid=24183 View this thread: http://www.excelforum.com/showthread...hreadid=384541 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
With Worksheets("Sheet1")
Textbox1.Text = Cstr(.Range("A1").Offset(.Cells(Rows.Count, "A").End(xlUp).Row - 1, 0).Value) End With -- HTH RP (remove nothere from the email address if mailing direct) "clarefoxly" wrote in message ... Hi, I have a user form to add jobs to my worksheet, each job has a job number which run in a list down the "A" column, the problem is you have to type the new job number in manual in the text box on the userform for ever new job.. Is the away to make it look down the list in column 'A' for the last one and then +1 onto it and auto load it into the job textbox on my userform? Thanks Clare -- clarefoxly ------------------------------------------------------------------------ clarefoxly's Profile: http://www.excelforum.com/member.php...o&userid=24183 View this thread: http://www.excelforum.com/showthread...hreadid=384541 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() thank you guys for your help, Private Sub UserForm_Initialize() g = Application.WorksheetFunction.CountA(Range("A:A")) a = Cells(g, 1) Label1.Caption = a + 1 End Sub works fine for a number list, but my list for example looks like, P011110 P011111 P011112 P01111... so on is it possable to make this work with a letter at the start of the list or if i put the P on its own in column A, can this then be made to work on column B on the 11110 part, iv tryed this myself but cant seem to get it to work with column B ? Thanks Clare. -- clarefoxly ------------------------------------------------------------------------ clarefoxly's Profile: http://www.excelforum.com/member.php...o&userid=24183 View this thread: http://www.excelforum.com/showthread...hreadid=384541 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Clare No need to do that. Change your third line thus: Label1.Caption = "P0" & a + 1 or TextBox1.Value = "P0" & a + 1 HTH DominicB -- dominicb ------------------------------------------------------------------------ dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932 View this thread: http://www.excelforum.com/showthread...hreadid=384541 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi, rite the best iv had is it being able to add onto list like P01, P02 But cant seem to get it to work for a list like P01236. Iv include the a sample file so you can see what I mean. the file anit ziped but just has the extention is changed, so just take the .zip off Thanks for the help DominicB Clare. +-------------------------------------------------------------------+ |Filename: last cell plus one.xls.zip | |Download: http://www.excelforum.com/attachment.php?postid=3576 | +-------------------------------------------------------------------+ -- clarefoxly ------------------------------------------------------------------------ clarefoxly's Profile: http://www.excelforum.com/member.php...o&userid=24183 View this thread: http://www.excelforum.com/showthread...hreadid=384541 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Clare I've fixed the problem you were having. Full explanation on the file. HTH DominicB +-------------------------------------------------------------------+ |Filename: last cell plus one.xls.zip | |Download: http://www.excelforum.com/attachment.php?postid=3577 | +-------------------------------------------------------------------+ -- dominicb ------------------------------------------------------------------------ dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932 View this thread: http://www.excelforum.com/showthread...hreadid=384541 |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Good afternoon ClareFoxly There is but we'll make a few assumptions as you've not given much information in your post. Private Sub UserForm_Initialize() g = Application.WorksheetFunction.CountA(Range("A:A")) a = Cells(g, 1) Label1.Caption = a + 1 End Sub Paste the code above into your userform's code section. This will look for the last row in column A and insert the value of the last row + 1 into a label called Label1. To insert the value into a text box, use this as the second to the last line: TextBox1.Value = a + 1 HTH DominicB -- dominicb ------------------------------------------------------------------------ dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932 View this thread: http://www.excelforum.com/showthread...hreadid=384541 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing Options | Excel Discussion (Misc queries) | |||
Code to copy the formulae of one cell to all the cell in the rangewith the specific cell and columnnumber changing | Excel Discussion (Misc queries) | |||
Populate a cell if values in cell 1 and cell 2 match cell 3 and 4 | Excel Worksheet Functions | |||
How to create/run "cell A equals Cell B put Cell C info in Cell D | Excel Discussion (Misc queries) | |||
data validation to restrict input in cell based on value of cell above that cell | Excel Programming |