PDA

View Full Version : overflow runtime error



Yjmmay34
08-19-2010, 06:35 AM
hi, all. during a run my macro, it occurs Run-time error '6': Overflow . Not sure where is the problem.


Function ASPformula()
Dim Str1 As String
Dim ERow As Integer

Sheets("PreOverall").Select
'Insert ASP formula at subtotal level
ActiveSheet.Outline.ShowLevels RowLevels:=1
Rows("7").Select
range(selection, selection.End(xlDown)).Select
ERow = selection.Rows.Count +6 "the error msg occurs in this step"

sorry cannot upload the example file as this is an company confidential information. Can anyone just give a suggestions???:dunno
Thank you!

Bob Phillips
08-19-2010, 06:41 AM
Function ASPformula()
Dim Str1 As String
Dim ERow As Long

Sheets("PreOverall").Select
'Insert ASP formula at subtotal level
ActiveSheet.Outline.ShowLevels RowLevels:=1
Rows("7").Select
range(selection, selection.End(xlDown)).Select
ERow = selection.Rows.Count +6 "the error msg occurs in this step"