Hello,
Im trying to get the text from a textbox to the last row of a table.
I do not want to add a new row, the row is already created by the macro and filled with data from column 1 to 6, I just want the text from the textbox to go in the last row of the seventh column.
Here is the code I'm trying to use:
Can someone please help?
Thank you
Im trying to get the text from a textbox to the last row of a table.
I do not want to add a new row, the row is already created by the macro and filled with data from column 1 to 6, I just want the text from the textbox to go in the last row of the seventh column.
Here is the code I'm trying to use:
HTML:
Private Sub CommandButton1_Click()
Dim the_sheet As Worksheet
Dim wltv As ListObject
Dim last_row As ListRow
Set the_sheet = Sheets("WorkLogT") 'WorkLogT is the name of the sheet
Set wltv = the_sheet.ListObjects("WLT") 'WLT is the name of the table
Set last_row = wltv.ListRows.Count
last_row.Range(1, 7).Value = txt_worklog
MsgBox "worklog submitted", 0, "Work log"
Unload WorkLogUF
End Sub
Can someone please help?
Thank you