View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default runtime error 6 overflow when running a macro

Kim,

How have you declare your other variables. If you declared one as
Integer, change it to Long.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Kim" wrote in message
...
hi. im trying to run a macro and it works perfectly till about
row 30,197
then it crashes and gives a runtime 6 error (overflow).

Dim g As Double


For g = b To Sheet1.Rows.Count
If UCase(Trim(Sheet1.Cells(g,
nSecondDefnColBegin).Value)) =
firstcell Then
nSecondDefnRow = g
Let b = g
Exit For
End If

Next g

the error happens in the row nSecondDefnRow = g. Any reasons
why this
happens? and how can i fix the problem? Thanks.

Kim