here am retrieving the data from sheet1 to userform then send it to sheet2 , i want to send to sheet7 also
here below the code for userfrm am using now
Private Sub cmdCancel_Click()
'Unload the userform
Unload Me
End Sub
Private Sub cmdOkay_Click()
Dim irow As Long
Dim ws As Worksheet
Set ws = Worksheets("Sheet2")
'find first row in database
irow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
With ws
.Range("A" & irow) = TextBox1.Value
.Range("B" & irow) = TextBox2.Value
.Range("C" & irow) = TextBox3.Value
.Range("D" & irow) = TextBox4.Value
End With
TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
TextBox4.Value = ""
End Sub
Private Sub ComboBox1_Change()
'vRange = "A1:C" & Cells(Rows.Count, "A").End(xlUp).Row
vRange = "FirstField"
TextBox1.Text = Application.VLookup(ComboBox1.Value, Sheets("Sheet1").Range(vRange), 1, False)
TextBox2.Text = Application.VLookup(ComboBox1.Value, Sheets("Sheet1").Range(vRange), 2, False)
TextBox3.Text = Application.VLookup(ComboBox1.Value, Sheets("Sheet1").Range(vRange), 3, False)
End Sub
Private Sub Label3_Click()
End Sub
Private Sub UserForm_Initialize()
'UserForm1.ComboBox1.RowSource = "A2:C" & Cells(Rows.Count, "A").End(xlUp).Row
UserForm1.ComboBox1.RowSource = "FirstField"
End Sub
Bookmarks