Hey everyone, I keep getting an error within my code and can't seem t
solve the problem. If you could all check it out and let me know. Firs
the code:
Code
-------------------
Option Explicit
Public Function styrene() As Double
Dim ExtCount As Integer, IntCount As Integer
ExtCount = 7
While ExtCount <= 15
For IntCount = 17 To 21
Dim additivereactor As Integer
additivereactor = ThisWorkbook.Worksheets("Input").Cells(IntCount, 4).Value
Dim results As Integer
results = ThisWorkbook.Worksheets("Calculations").Cells(19, ExtCount).Value
If additivereactor = results Then
styrene = ThisWorkbook.Worksheets("calculations").Cells((Int Count - 15), 6).Value + styrene
Else
styrene = styrene + 0
End If
ThisWorkbook.Worksheets("Calculations").Cells(20, ExtCount).Value = styrene
Next IntCount
ExtCount = ExtCount + 1
Wend
End Function
-------------------
additivereactor and results are always integers. The error is this lin
of code:
Code
-------------------
results = ThisWorkbook.Worksheets("Calculations").Cells(19, ExtCount).Value
-------------------
Any help is appreciated.
~Jaso
--
jclark41
-----------------------------------------------------------------------
jclark419's Profile:
http://www.excelforum.com/member.php...fo&userid=2543
View this thread:
http://www.excelforum.com/showthread.php?threadid=39057