I have a bit of a strange one.
I have a workbook, that is a file downloaded from the internet, from one of my suppliers. I then have a couple of Macros I run to manipulate the file into the format I want.
Once everything is formatted, I am left with a number of rows which are erroneous that I dont need, so I have another macro to remove these rows based on a value that is in a cell on each row.
the macro I have is as follows:
So as you can see, I want this to look in column H down to row 3500, if the value 5.42 is found I want that entire row to be removed.
The problem I am having, is that the macro is running, but not removing all rows that have this value. I have to run the macro multiple times for it to remove all rows, usually 3 ro 4 times.
There are about 250 rows in total that need to be removed, but the macro is only removing a small amount of these at any time.
Any thouhgts why this isnt working as expected?
I have a workbook, that is a file downloaded from the internet, from one of my suppliers. I then have a couple of Macros I run to manipulate the file into the format I want.
Once everything is formatted, I am left with a number of rows which are erroneous that I dont need, so I have another macro to remove these rows based on a value that is in a cell on each row.
the macro I have is as follows:
VBA Code:
Sub deleteend()
Dim cell As Range
Windows("gamma.csv").Activate
For Each cell In Range("H2:H3500")
If cell.Value = 5.42 Then
cell.EntireRow.Delete
End If
Next cell
End Sub
So as you can see, I want this to look in column H down to row 3500, if the value 5.42 is found I want that entire row to be removed.
The problem I am having, is that the macro is running, but not removing all rows that have this value. I have to run the macro multiple times for it to remove all rows, usually 3 ro 4 times.
There are about 250 rows in total that need to be removed, but the macro is only removing a small amount of these at any time.
Any thouhgts why this isnt working as expected?