Hi all, hope you had a great weekend.
I'm writing another VBA to automate my coworker's manual processes and this I've got a syntax error but the Monday brain isn't working. My first step is to ensure old data is gone before importing new data on a few of the many sheets available.
On sheets "EPIC" and "EPIC_FEAT" I want to delete row 3 to wherever the end of the data is. This is what I've got so far
I get the Run-time error '1004': Application-defined or object-defined error at
I tried also
. It seems like this code is very close but can figure the issue out..
They don't let me install apps so can't upload a Mini-sheet but headers are on row there are multiple columns; something like below:
How would you do this task? Thanks, as always, for helping me learn!
I'm writing another VBA to automate my coworker's manual processes and this I've got a syntax error but the Monday brain isn't working. My first step is to ensure old data is gone before importing new data on a few of the many sheets available.
On sheets "EPIC" and "EPIC_FEAT" I want to delete row 3 to wherever the end of the data is. This is what I've got so far
VBA Code:
Sub DeleteRows()
Dim shArr, i As Long, xx As Long
shArr = Array("EPIC", "EPIC_FEAT")
xx = Range("A3").End(xlDown).Select
For i = LBound(shArr) To UBound(shArr)
Sheets(shArr(i)).Selection(xx).EntireRow.Delete
Next i
End Sub
I get the Run-time error '1004': Application-defined or object-defined error at
Code:
Sheets(shtArr(i)).Selection(xx).EntireRow.Delete
Code:
Sheets(shtArr(i)).Rows(xx).EntireRow.Delete
They don't let me install apps so can't upload a Mini-sheet but headers are on row there are multiple columns; something like below:
Name | Key | Summary |
hgfgjh | dsfafsaf | adsfasdfasfdasfd |
fghjfhj | asdfasdfsaf | |
fhjg | dsfasdf | adsfasfd |
sfdgdsg | sdfsadf | |
sdfdsfg | sdfasdf | |
sdfgdsgf | asfdadsf | asdfsafd |
sdfgdsgf | asdfasf | |
sdfgdsgf | adfadsf | asdffsda |
gsdgf | asfdsafd |
How would you do this task? Thanks, as always, for helping me learn!