r/vbscript • u/FBM25 • Oct 24 '14
Code not deleting rows?
Hi everyone! I'm writing a script that will, among other things, delete a row that has a certain value in the first cell, as well as every row above that one. However, it's not working, at all. I'm not receiving any error though, so I'm confused! Can anyone shed any insight? The part of the code is:
i = 1
If objExcel.Cells(i, 1).Value = "XXX" Then
Set objRange = objExcel.Cells(i, 1).EntireRow
objWorkSheet.Rows("1:objRange").Delete
elseif objExcel.Cells(i, 1).Value <> "XXX" Then
On Error Resume Next
End If
i = i + 1Thanks!
1
Upvotes
View all comments
Show parent comment
1
u/demigod987 Oct 24 '14
Ok, some other thoughts:
Does that get you anywhere?