PDA

View Full Version : Add records to table (excel)



enfantter
09-27-2007, 01:27 AM
Hey yall!
I have a form which includes 5 textboxes. I would like to transport those 5 entries as a new record in the sheet (matching the 5 columns).
Does anyone know an easy way?!

/JackJackJack.dk

Bob Phillips
09-27-2007, 01:39 AM
With Worksheets("Data")
LastRow = .Cells(.Rows.Count,"A").End(xlUp).Row
.Cells(LastRow+1,"A").Value = TextBox1.Text
.Cells(LastRow+1,"B").Value = TextBox2.Text
.Cells(LastRow+1,"C").Value = TextBox3.Text
.Cells(LastRow+1,"D").Value = TextBox4.Text
.Cells(LastRow+1,"E").Value = TextBox5.Text
End With