Hi All,
I'm having an issue with one of my spreadsheets where if I apply a filter to my table and then attempt to add a new row using a macro, I get a run time error which I cant seem to get passed!
Note: the spreadsheet must be able to add a new row whilst the table is filtered (the table gets shorter depending on the values being filtered)
I'm still new to using VBA but this is the code I'm currently using which copies a blank row with all the formatting in place and pastes as a new row to the bottom of the table;
Is there a way to do add a new row whilst filters have been applied in this way?
Thanks
J
I'm having an issue with one of my spreadsheets where if I apply a filter to my table and then attempt to add a new row using a macro, I get a run time error which I cant seem to get passed!
Note: the spreadsheet must be able to add a new row whilst the table is filtered (the table gets shorter depending on the values being filtered)
I'm still new to using VBA but this is the code I'm currently using which copies a blank row with all the formatting in place and pastes as a new row to the bottom of the table;
VBA Code:
Public Sub Add_new_row_2()
Dim tbl As ListObject
Dim rw As Range
Set tbl = Sheets("Master Input").ListObjects(1)
Set rw = tbl.ListRows.Add.Range
Sheets("Master Input").Range("A2:HS2").Copy rw
End Sub
Is there a way to do add a new row whilst filters have been applied in this way?
Thanks
J