B
Bob Allen
I get a run-time error '91' with the line of code - StartUpSheet(RowCounter,
1) = cellVal - in the code below. I've used the Excel help - but can't
figure out what object variable I need to set. What don't I understand? I've
dimensioned the array and other variables in a global variable area at the
head of the application code.
Bob Allen
RowCounter = 0
CellCounter = 0
nextChkBox = 1
ActiveRow = 0
Worksheets("Start_Up_Pricing").Activate
For Each cell In Range("A3:B86")
CellCounter = CellCounter + 1
cellVal = cell.Value
MsgBox cellVal
If MsgBox("quit now", vbYesNo) = vbYes Then
GoTo bob1
End If
a = CellCounter Mod 2
If CellCounter = 1 Then a = 0
If a = 0 Then ColumnA = yes
If ColumnA = yes Then
RowCounter = RowCounter + 1
'ActiveRow = ActiveRow + 1
StartUpSheet(RowCounter, 1) = cellVal
StartUpSheet(RowCounter, 2) = cell.Offset(0, 1).Value
StartUpSheet(RowCounter, 3) = cell.Offset(0, 3).Value
StartUpSheet(RowCounter, 4) = cell.Offset(0, 4).Value
StartUpSheet(RowCounter, 5) = cell.Offset(0, 5).Value
End If
array_5 = StartUpSheet(RowCounter, 5)
MsgBox array_5
Next cell
GoTo bob1
1) = cellVal - in the code below. I've used the Excel help - but can't
figure out what object variable I need to set. What don't I understand? I've
dimensioned the array and other variables in a global variable area at the
head of the application code.
Bob Allen
RowCounter = 0
CellCounter = 0
nextChkBox = 1
ActiveRow = 0
Worksheets("Start_Up_Pricing").Activate
For Each cell In Range("A3:B86")
CellCounter = CellCounter + 1
cellVal = cell.Value
MsgBox cellVal
If MsgBox("quit now", vbYesNo) = vbYes Then
GoTo bob1
End If
a = CellCounter Mod 2
If CellCounter = 1 Then a = 0
If a = 0 Then ColumnA = yes
If ColumnA = yes Then
RowCounter = RowCounter + 1
'ActiveRow = ActiveRow + 1
StartUpSheet(RowCounter, 1) = cellVal
StartUpSheet(RowCounter, 2) = cell.Offset(0, 1).Value
StartUpSheet(RowCounter, 3) = cell.Offset(0, 3).Value
StartUpSheet(RowCounter, 4) = cell.Offset(0, 4).Value
StartUpSheet(RowCounter, 5) = cell.Offset(0, 5).Value
End If
array_5 = StartUpSheet(RowCounter, 5)
MsgBox array_5
Next cell
GoTo bob1