Skip to main content
Support is Offline
Today is our off day. We are taking some rest and will come back stronger tomorrow
Official support hours
Monday To Friday
From 09:00 To 17:30
  Thursday, 20 September 2018
  0 Replies
  3.3K Visits
0
Votes
Undo
I have a time card for multiple people. Each time card has a table where the data is entered which then rolls up to a summary sheet. Each table has only one row, I need to make a macro that will enter a new row as needed on each time sheet. I can get the macro to work for one sheet at a time by changing the sheet name on the macro. I need to know how to make a macro that will add a new row, but that can use a wild card for the sheet name, or: I have another macro to dynamically change the sheet name based on the cell value of A1. Is there a way to make VBA, when it's looking for the sheet name reference the value of A1?


Sub NewRow()
Dim ws As Worksheet
Set ws = ActiveSheet
Dim tbl As ListObject
Set tbl = ws.ListObjects("sheet name")
tbl.ListRows.Add
End Sub

Thanks,
There are no replies made for this post yet.