LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default Error Code 6: Overflow

Just when I thought I had it!!!

Here is my code:

Private Sub Tabulate()

' Keyboard Shortcut: Ctrl+x


Dim WSDSD As Worksheet
Set WSDSD = Worksheets("Data SD")
Dim WSRep As Worksheet
Set WSRep = Worksheets("Report")
Dim WSCri As Worksheet
Set WSCri = Worksheets("Criteria")

Dim Monthrange As Range
Set Monthrange = ThisWorkbook.Names("Monthrange").RefersToRange
Dim Yearrange As Range
Set Yearrange = ThisWorkbook.Names("Yearrange").RefersToRange
Dim Locrange As Range
Set Locrange = ThisWorkbook.Names("Locrange").RefersToRange
Dim Typerange As Range
Set Typerange = ThisWorkbook.Names("Typerange").RefersToRange
Dim Counrange As Range
Set Counrange = ThisWorkbook.Names("Counrange").RefersToRange

Dim ProVa As String
ProVa = WSCri.Range("C3").Value
Dim YrVa As String
YrVa = WSCri.Range("C10").Value
Dim MthVa As String
MthVa = WSCri.Range("C11").Value
Dim LocVa As Range
Set LocVa = WSCri.Range("C23")
Dim UnVa As Range
Set UnVa = WSCri.Range("C28")
Dim TyVa As Range
Set TyVa = WSCri.Range("C32")

Dim MRRCYTo As Range
Set MRRCYTo = WSRep.Range("D7")

Dim MRRrange As Range
Set MRRrange = ThisWorkbook.Names("MRRrange").RefersToRange

'When the scope is District
If ProVa = 0 And LocVa.Value = "" Then
MRRCYTo.Value =
WSDSD.Evaluate("=SUMPRODUCT((MRRrange<200000)*(MRR range<0)*(Typerange=""" &
TyVa.Value & """)*(Yearrange=" & YrVa & ")*(Monthrange=" & MthVa & "))") /
WSDSD.Evaluate("=SUMPRODUCT((MRRrange1)*(Typerang e=""" & TyVa.Value &
""")*(Yearrange=" & YrVa & ")*(Monthrange=" & MthVa & "))")
End If

End Sub


Ok....when I change the reference cell of TyVa and run the subroutine again,
I get the overflow error?



--
Thanks
Shawn
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Overflow error.. why? Fingerjob Excel Discussion (Misc queries) 4 November 13th 06 05:18 PM
Overflow Error DG Excel Discussion (Misc queries) 3 April 15th 05 05:45 PM
Overflow Error DG Excel Programming 3 April 15th 05 05:45 PM
Help! Overflow Error 6 Gauthier Excel Programming 6 September 24th 04 12:57 PM
overflow error ExcelMonkey[_5_] Excel Programming 6 January 22nd 04 02:34 AM


All times are GMT +1. The time now is 11:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"