Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Nested For statements
Hi Team
I sincerely trust you're all keeping well during this Topsy-turfy time. This is my current code which works as expected: Dim cRoute As String Dim i As Integer For i = 2 To 500 cRoute = Sheets("Conversion").Range("A" & i).Value If Module3.testRouteSheetorAdd(cRoute) Then Call Module3.transferCommittedRoute(cRoute, i) End If Next i I would like to expand it so that it only creates sheets based on the value of another sheet (cStatus = "Y"): This next code is not working: Dim cRoute As String Dim fRoute As String Dim i As Integer Dim j As Integer For i = 5 To 50 cStatus = Sheets("Fleet Summary").Range("H" & i).Value If cStatus = "Y" Then fRoute = Sheets("Fleet Summary").Range("A" & i).Value For j = 2 To 500 cRoute = Sheets("Conversion").Range("A" & j).Value If cRoute = fRoute Then If Module3.testRouteSheetorAdd(cRoute) Then Call Module3.transferCommittedRoute(cRoute, j) End If End If Next j End If Next i As always, many thanks for any assistance. Cheers Mark |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Nested if statements | Excel Worksheet Functions | |||
Too Many Nested IF Statements! | Excel Worksheet Functions | |||
Nested IF statements | Excel Programming | |||
nested if statements | Excel Worksheet Functions | |||
Nested If statements | Excel Programming |