+ Reply to Thread
Results 1 to 2 of 2

Still learning .....

  1. #1
    Registered User
    Join Date
    05-16-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    1

    Smile Still learning .....

    I'm hoping someone can help me with this: I have created an excel userform that I need at work and can't seem to figure something out.

    I have text boxes that flow into a worksheet by the rows but I need columns. One item could have up to eight different distributors. I need to figure out how I can code new comboboxes to flow under the 'one' column. My current code is this (minus the additional comboboxes that I will have to add):

    Private Sub CommandButton1_Click()
    Dim I As Integer

    I = MsgBox("Are You Sure You Entered Data In Each Field?", vbYesNo)
    If I = vbYes Then
    MsgBox ("Form Will Now Reset")
    Dim LastRow As Long

    LastRow = Worksheets("sales data").Range("A65536").End(xlUp).Row + 1
    ActiveWorkbook.Sheets("sales data").Activate
    Range("A" & LastRow).Value = ComboBox1.Text
    Range("B" & LastRow).Value = TextBox1.Text
    Range("C" & LastRow).Value = TextBox2.Text
    Range("D" & LastRow).Value = TextBox7.Text
    Range("E" & LastRow).Value = ComboBox2.Text
    Range("F" & LastRow).Value = ComboBox3.Text
    Range("g" & LastRow).Value = TextBox3.Text
    Range("h" & LastRow).Value = TextBox6.Text
    Range("i" & LastRow).Value = TextBox4.Text
    Range("j" & LastRow).Value = TextBox5.Text





    'clear the data
    Me.ComboBox1.Value = ""
    Me.TextBox1.Value = ""
    Me.TextBox2.Value = ""
    Me.TextBox7.Value = ""
    Me.ComboBox2.Value = ""
    Me.ComboBox3.Value = ""
    Me.TextBox3.Value = ""
    Me.TextBox6.Value = ""
    Me.TextBox4.Value = ""
    Me.TextBox5.Value = ""








    End If


    End Sub


    I would be very grateful if someone could lead the way on this.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Still learning .....

    Hi Weatherbee, welcome to the forum.

    Please take a moment to read the forum rules (link in my signature below) and then amend your thread title to something descriptive of your problem. Also, please edit your post to include [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags around your code, which makes it easier to read and stand out from the rest of your post.

    Once you have done this please send me a PM and I will remove this request. Thanks!

+ Reply to Thread

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