View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Kim Kim is offline
external usenet poster
 
Posts: 284
Default runtime error 6 overflow when running a macro

Tried that. didn't solve the error.

"ADG" wrote:

Try change g to data type long instead of Double
--
Tony Green


"Kim" wrote:

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