I am adding a new row to the table I have in the active sheet using the following method:
ActiveSheet.ListObjects("MyDataTable1").ListRows.Add(AlwaysInsert:=True)
The problem is that it is dependent on the table name "MyDataTable1". If I change the active sheet to the one in which the name of table is "MyDataTable2", I have to change my code too. Is there anyway to find the table in the active sheet automatically so that I do not need to change the code every time I switch between the sheets?