Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Nexted For Statements don't execute fully

I am trying to use the following code to display all cell colors with all
border colors.
For some reason that I can't understand though, execution always stops
before the nested for statements can finish. The most it will get through is
i = 55 and j = 42.

Sub color()
Dim i, j As Integer
i = 0
j = 0

Worksheets("sheet4").Visible = True
For i = 1 To 56
For j = 1 To 56
Range("a3") = i
Range("a6") = j

Worksheets("Sheet4").Cells(i, j).Interior.ColorIndex = i
Worksheets("Sheet4").Cells(i, j).Borders.ColorIndex = j

Next j
Next i

End Sub

Is there some kind of internal limit Excel has to how many color
combinations can exist on one worksheet? I know that there are a maximum of
4000 styles, but there are only 55 * 42 = 2310 combinations here, not styles.
Why won't the program execute all the way?

Reply
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
Page not fully printing... Patrick Excel Discussion (Misc queries) 2 January 1st 10 01:52 PM
REVISED Nexted IF and Countif LPS Excel Worksheet Functions 3 December 5th 07 07:53 PM
Nexted if()s are limited to Seven What other functions can I use? dan Excel Worksheet Functions 8 October 24th 06 05:07 AM
nexted for next loops dr chuck Excel Programming 4 October 4th 06 05:02 PM
Fully functional spreadsheets on web? famdamly Excel Discussion (Misc queries) 4 April 18th 06 10:21 AM


All times are GMT +1. The time now is 11:12 PM.

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"