Next Row skips single row

Exceluser111

New Member
Joined
Jan 14, 2015
Messages
7
I have a data set and I am using the following for loop:

VBA Code:
    For Each Row In lookupRange.Rows
        Debug.Print Row.Cells(10).Address
        
        If Row.Cells(10).Value < lookupValue Then
            Row.Cut destWorksheet.Range("A" & lastRow)
            lastRow = lastRow + 1
        End If

        
    Next Row

now for whatever reason, this for loop just doesn't even look at row 9, it goes from 8 to 10 and I cannot for the life of me figure out why.
Utilizing the debug print I can confirm that out of the 97 lines, only row 9 which happens to be the second row (row 8 to 104) gets completely skipped.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
what is the rest of the code nothing in the code above shows to being skipping
 
Upvote 0
what is the rest of the code nothing in the code above shows to being skipping
From my research, it appears to be an issue with the cut and paste functionality in Excel, you can change my above code to copy in lieu of cut and it works. Something wonky with cutting, I will find a different solution.
 
Upvote 0

Forum statistics

Threads
1,216,093
Messages
6,128,784
Members
449,468
Latest member
AGreen17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top