J
jclark419
Hey guys, this should be a simple one but I still havn't gotten it. The
code is here:
Code:
--------------------
Public Function results() As Double
Dim answers(9, 9) As Double
Dim i, j, component As Integer
For i = 20 To 29
For j = 7 To 15
ThisWorkbook.Worksheets("Calculations").Cells(i, j).Activate
component = ThisWorkbook.Worksheets("Calculations").Cells(ActiveCell.row, 6).Value
Select Case component
Case 1
answers(i, j) = conversion(i, j) + flush(i, j) + additive(i, j)
Case 2
answers(i, j) = conversion(i, j) + flush(i, j) + additive(i, j)
Case Else
answers(i, j) = conversion(i, j)
End Select
Next j
Next i
End Function
--------------------
Conversion, Flush and Additive are all seperate functions being called
to from here. The error is in this line:
Code:
--------------------
ThisWorkbook.Worksheets("Calculations").Cells(i, j).Select
--------------------
It returns a select range error on this line implying that it is not
properly addressed.
Thanks.
~Jason
code is here:
Code:
--------------------
Public Function results() As Double
Dim answers(9, 9) As Double
Dim i, j, component As Integer
For i = 20 To 29
For j = 7 To 15
ThisWorkbook.Worksheets("Calculations").Cells(i, j).Activate
component = ThisWorkbook.Worksheets("Calculations").Cells(ActiveCell.row, 6).Value
Select Case component
Case 1
answers(i, j) = conversion(i, j) + flush(i, j) + additive(i, j)
Case 2
answers(i, j) = conversion(i, j) + flush(i, j) + additive(i, j)
Case Else
answers(i, j) = conversion(i, j)
End Select
Next j
Next i
End Function
--------------------
Conversion, Flush and Additive are all seperate functions being called
to from here. The error is in this line:
Code:
--------------------
ThisWorkbook.Worksheets("Calculations").Cells(i, j).Select
--------------------
It returns a select range error on this line implying that it is not
properly addressed.
Thanks.
~Jason