Skipping a row if a value is present

kpierce

Board Regular
Joined
Jun 21, 2010
Messages
76
Hello,
Thanks for all the help on this forum, I am just about finished with my spreadsheet. I could have not done it without everyone's support.

I do need one additional piece of guidance.

The following code works great, but what I need to do now, is check column U and if this has a value of "No", skip to the next row in the desitnation worksheet.

Logically that is simple enough, just IF U="No", but then that seems to throw everything off...

I want to check the destination cell "U" & cDestRow and if it is "No", go to the next cDestRow, and if that one is "No", go to the next and so on. Until it finds an open cDestRow (where U<>"No") or cDestRow = 31.

Any guidance is much appreciated. I have been monkeying with this all day and I am sure it is something very simple.
thanks

Code:
    For Each ws In ActiveWorkbook.Sheets
 
        If ws.Range("A2") = "Project Status Report:" Then
            For Each RCell In ws.[R25:R31]
                If RCell.Value = "Yes" Then
                   ' Write Status and Description
                   Set rngDest = Sheets(PMSheet).Range("K" & cDestRow, "M" & cDestRow)
                    rngDest.Value = ws.Range("I" & RCell.Row, "K" & RCell.Row).Value
                   ' Write Owner and Due Date
                   Set rngDest = Sheets(PMSheet).Range("S" & cDestRow, "T" & cDestRow)
                    rngDest.Value = ws.Range("P" & RCell.Row, "Q" & RCell.Row).Value
                        cDestRow = cDestRow + 1
                    If cDestRow = 31 Then
                        MsgBox "There are more than seven items escalated from Projects to the Program, only first Seven have been imported"
                        Exit For
                    End If
                End If
            Next RCell
        End If
    Next ws
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

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