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

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