Project217
New Member
- Joined
- Mar 7, 2022
- Messages
- 24
- Office Version
- 365
- Platform
- MacOS
HI All.
I am trying to add a user form to an excel data table with formulas, I have managed to get the user form to add the data to the table, however it keeps over writing the data on the first row of the data table and not inputting it on there next available row, Can you please help me with this?
This is the VBA I have used.
Private Sub CommandButton1_Click()
Dim irow As Long
Dim ws As Worksheet
Set ws = Worksheets("Master Sheet")
'find first empty row in database
lRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
With ws
.Range("D4") = TextBox4.Value
.Range("R4") = TextBox5.Value
.Range("C4") = TextBox6.Value
End With
TextBox4.Value = ""
TextBox5.Value = ""
TextBox6.Value = ""
End Sub
Any help on this would be awesome! Thanks.
Rory.
I am trying to add a user form to an excel data table with formulas, I have managed to get the user form to add the data to the table, however it keeps over writing the data on the first row of the data table and not inputting it on there next available row, Can you please help me with this?
This is the VBA I have used.
Private Sub CommandButton1_Click()
Dim irow As Long
Dim ws As Worksheet
Set ws = Worksheets("Master Sheet")
'find first empty row in database
lRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
With ws
.Range("D4") = TextBox4.Value
.Range("R4") = TextBox5.Value
.Range("C4") = TextBox6.Value
End With
TextBox4.Value = ""
TextBox5.Value = ""
TextBox6.Value = ""
End Sub
Any help on this would be awesome! Thanks.
Rory.