Macro not working

I want to delete in excel sheet after filter.All records delete except first row.but when I try to run this I getting this error as mention in attachment.I try to run this in uipath but got error in excel may be as mention in attachment untitle.png not select second row first column.
How can I select all rows except first row.




@Palaniyappan

You want to remove all records except for headers ryt??
try this

Sub Macro5()

Rows("2:30000").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp

End Sub

or for filtered data
Sub Macro7()

Rows("1:1").Select
Selection.Offset(1, 0).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Delete Shift:=xlUp

End Sub

no except first row and header also

Sub Mac()

Rows("2:30000").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp

End Sub

Code will remove data from 2nd row u can set n number for rows

ok thanks but you mention this
Rows(“2:30000”).Select this range…??

I have idea that i dont have data more than 30000 so i have ryt that range u can use upto last row i.e. 1048576

not work for me

What error u r getting

use this code

You want to delete filtered data only?