Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can anyone tell me why sometimes this code should fail on line 5 with y=0 ...
1 Private Sub PopulatecmbGrades() 2 Dim y As Single 3 With Sheets("Sheet5") 4 For y = 3 To .[H3].CurrentRegion.Rows.count 5 cmbGCodes.AddItem .Cells(y, 8) 6 cmbGrades.AddItem .Cells(y, 9) 7 Next 8 End With 9 cmbGCodes.ListIndex = 0 10 cmbGrades.ListIndex = 0 11 End Sub .[H3].CurrentRegion.Rows.count = 13 currently I do use y elsewhere and it may be 0 but a) it would be out of scope here and b) it should be set by the For loop. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Let's try again: VBA Code stops randomly | Excel Programming | |||
String Array initialisation | Excel Programming | |||
String array initialisation | Excel Programming | |||
DTPicker to be dropped down on initialisation | Excel Programming | |||
Excel formula randomly changes to hard-code number | Excel Discussion (Misc queries) |