Hi Guys,
I have combobox1 contains sheets names and textbox1,2,3,4
what I look for it when select sheet from combobox 1 and copy data are filled in all of textboxes to sheet where select from combobox should increment number in column A 1,2,3.... based on filling of adjacent cells for column B . it gives error "object doesn't support this property " in this line
.Columns(1).Value = .Parent.Evaluate("Row(1:" & .Rows.Count & ")")
Private Sub CommandButton1_Click()
Dim lr As Long, sh As Worksheet
Set sh = Sheets(ComboBox1.value)
lr = sh.Range("A" & Rows.Count).End(xlUp).Row
With sh
.Range("B" & lr + 1) = TextBox1.Value
.Range("C" & lr + 1) = TextBox2.Value
.Range("D" & lr + 1) = TextBox3.Value
.Range("E" & lr + 1) = TextBox4.Value
.Columns(1).Value = .Parent.Evaluate("Row(1:" & .Rows.Count & ")")
.Columns(1).NumberFormat = "General"
End With
End Sub
I look forward anybody tell me what's the right way to work the code correctly .
thanks