For Each Cell stopping after first

sharky12345

Well-known Member
Joined
Aug 5, 2010
Messages
3,422
Office Version
  1. 2016
Platform
  1. Windows
I'm trying to copy data across to another sheet if a condition is met.

The condition is the value 'Unresolved' in column K - this is what I have so far;

Code:
Nextrow = Sheet14.Range("A65536").End(xlUp).Row + 1

For Each cell In Sheet7.Range("A2:A" & LastRow)
If cell.Offset(0, 10).Value = "Unresolved" Then
Sheet14.Range("A" & Nextrow).Value = cell.Offset(0, 2).Value
Sheet14.Range("B" & Nextrow).Value = cell.Offset(0, 3).Value
Sheet14.Range("C" & Nextrow).Value = cell.Offset(0, 6).Value
Sheet14.Range("D" & Nextrow).Value = cell.Offset(0, 7).Value
Sheet14.Range("E" & Nextrow).Value = cell.Offset(0, 8).Value
Sheet14.Range("F" & Nextrow).Value = cell.Offset(0, 9).Value
Sheet14.Range("G" & Nextrow).Value = cell.Offset(0, 10).Value
End If
Next

The issue is that is finds the first row where that condition is met and copies the data across fine, but stops there and does no more.

Can anyone advise where I am going wrong please?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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