cvanderweide92177
New Member
- Joined
- Jun 17, 2019
- Messages
- 1
below is the code i have so far. It works to bring the data from the userform to the sheet i want but it starts it in row 2. I want it to start in row 17.
Private Sub CommandButton1_Click()
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("OUC_Vistana")
Dim n As Long
n = sh.Range("A" & Application.Rows.Count).End(xlUp).Row
sh.Range("K" & n + 1).Value = Me.ComboBox1.Value
sh.Range("L" & n + 1).Value = Me.TextBox1.Value
sh.Range("M" & n + 1).Value = Me.ComboBox2.Value
sh.Range("N" & n + 1).Value = Me.TextBox2.Value
'''''clear data'''''
Me.TextBox1.Value = " "
Me.TextBox2.Value = " "
Me.ComboBox1.Value = " "
Me.ComboBox2.Value = " "
'''''close form'''''
UserForm15.Hide
Private Sub CommandButton1_Click()
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("OUC_Vistana")
Dim n As Long
n = sh.Range("A" & Application.Rows.Count).End(xlUp).Row
sh.Range("K" & n + 1).Value = Me.ComboBox1.Value
sh.Range("L" & n + 1).Value = Me.TextBox1.Value
sh.Range("M" & n + 1).Value = Me.ComboBox2.Value
sh.Range("N" & n + 1).Value = Me.TextBox2.Value
'''''clear data'''''
Me.TextBox1.Value = " "
Me.TextBox2.Value = " "
Me.ComboBox1.Value = " "
Me.ComboBox2.Value = " "
'''''close form'''''
UserForm15.Hide