Results 1 to 13 of 13

adding consecutive number to userform textbox

Threaded View

  1. #1
    Forum Contributor
    Join Date
    01-28-2007
    MS-Off Ver
    2019
    Posts
    204

    adding consecutive number to userform textbox

    i've got a sample database (attached) with a userform for inputting of data. What i want it to do is automatically generate the next number and add it to textbox "our ref" on the userform. the number is in Col C. This is the code i've tried using the code highlighted in red which doesnt work..... can you point me in the right direction ?

    i've attached said file...

    Private Sub UserForm_Initialize()
    Application.ScreenUpdating = False
    Worksheets("DATA").Select
    Range("A2").Select
    Do Until ActiveCell.Value = ""
        UserForm1.ComboBox1.AddItem ActiveCell.Value
        ActiveCell.Offset(1, 0).Select
    Loop
    
    Worksheets("DATA").Select
    Range("B2").Select
    Do Until ActiveCell.Value = ""
        UserForm1.ComboBox2.AddItem ActiveCell.Value
        ActiveCell.Offset(1, 0).Select
    Loop
    
    Worksheets("DATA").Select
    Range("c2").Select
    Do Until ActiveCell.Value = ""
        UserForm1.ComboBox3.AddItem ActiveCell.Value
        ActiveCell.Offset(1, 0).Select
    Loop
    Worksheets("RESULTS").Select
    Range("C1").Select
    nextNumber = Sheets("RESULTS").Range("C1").Value + 1
    
        UserForm1.TextBox3.AddItem nextNumber.Value
        
      
        Loop
        
    Worksheets("Results").Select
    End Sub
    Attached Files Attached Files
    Last edited by royUK; 04-10-2008 at 08:53 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1