LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested if statements JICDB Excel Worksheet Functions 2 November 20th 07 06:48 PM
Too Many Nested IF Statements! Tiziano Excel Worksheet Functions 5 October 3rd 07 02:29 AM
Nested IF statements Rod from Corrections Excel Programming 4 March 28th 07 11:36 PM
nested if statements Jeremy Excel Worksheet Functions 2 September 14th 06 08:08 PM
Nested If statements Robert Christie[_3_] Excel Programming 2 January 23rd 05 05:27 PM


All times are GMT +1. The time now is 03:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"