im2bz2p345
Board Regular
- Joined
- Mar 31, 2008
- Messages
- 229
Hi guys,
I keep getting the error Run-time error '6': Overflow when I try to run my macro. My macro basically opens up a source file and I want it to calculate a value based on a formula (C77/C79*C80), but I keep getting an error. Could anyone help with this?
When I step through the code, I get the error at the line in red above.
Appreciate any help,
~ Im2bz2p345
I keep getting the error Run-time error '6': Overflow when I try to run my macro. My macro basically opens up a source file and I want it to calculate a value based on a formula (C77/C79*C80), but I keep getting an error. Could anyone help with this?
Rich (BB code):
For Each Dn In Rng
If InStr(SourceFile, Dn.Value) > 0 Then
Filematched = True
num = Dn.Row
Workbooks.Open (SourceFile)
Set XLSFile = ActiveWorkbook
MsgBox (ActiveWorkbook.Name)
' -- Do your stuff here--.
CalcValue = Range("C77").Value / Range("C79").Value * Range("C80").Value
ThisWorkbook.Sheets("All Regions_Detail").Range("AL" & num) = CalcValue
End If
When I step through the code, I get the error at the line in red above.
Appreciate any help,
~ Im2bz2p345