• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Introduce drop down in a form - error showing up in enclosed code ComboBox1

Ramesha

Member
Code:
Option Explicit

Private Sub Enter_Click()
Dim lr As Integer
lr = Range("A" & Rows.Count).End(xlUp).Row + 1

'Save values to Sheet1 Next row
Sheets("Sheet1").Cells(lr, 1) = UserForm1.TextBox1.Text
Sheets("Sheet1").Cells(lr, 2) = UserForm1.TextBox2.Text
Sheets("Sheet1").Cells(lr, 3) = UserForm1.TextBox3.Text
Sheets("Sheet1").Cells(lr, 4) = UserForm1.TextBox4.Text
Sheets("Sheet1").Cells(lr, 5) = UserForm1.TextBox5.Text
Sheets("Sheet1").Cells(lr, 6) = UserForm1.TextBox6.Text

Sheets("Sheet1").Cells(lr, 8) = UserForm1.TextBox7.Text
Sheets("Sheet1").Cells(lr, 9) = UserForm1.TextBox8.Text
Sheets("Sheet1").Cells(lr, 10) = UserForm1.TextBox9.Text
Sheets("Sheet1").Cells(lr, 11) = UserForm1.TextBox10.Text
Sheets("Sheet1").Cells(lr, 12) = UserForm1.TextBox11.Text

Sheets("Sheet1").Cells(lr, 13) = UserForm1.ComboBox1.Text

'Clear Input form
UserForm1.TextBox1.Text = CStr(CInt(UserForm1.TextBox1.Text) + 1)

UserForm1.TextBox2.Text = ""
UserForm1.TextBox3.Text = ""
UserForm1.TextBox4.Text = ""
UserForm1.TextBox5.Text = ""
UserForm1.TextBox6.Text = ""
UserForm1.TextBox7.Text = ""
UserForm1.TextBox8.Text = ""
UserForm1.TextBox9.Text = ""
UserForm1.TextBox10.Text = ""
UserForm1.TextBox11.Text = ""

End Sub

Private Sub UserForm_Initialize()
ComboBox1.ListIndex = 0
End Sub
 
I see you used ListIndex but where are you defining what values are populated in the list & please attach sample file
 
Here the file.
U were unable to upload due to size was larger than the allowed limit.
 

Attachments

  • BackUP_TEST.xlsb
    942.8 KB · Views: 0
Back
Top