+ Reply to Thread
Results 1 to 2 of 2

Run-time error '6': Overflow

  1. #1
    Registered User
    Join Date
    03-27-2005
    Posts
    13

    Run-time error '6': Overflow

    I do not really know VBA, but did put together some macros. They use to work but now I get this error

    Run-time error '6':
    Overflow

    The following is the code. I get the error on the last line when I debug. Any idea what is wrong? Thanks

    [/code]
    Sub ColorRate()
    Dim LastR As Integer, CurrRow As Integer
    Dim PercRange As Range, Thing
    Sheets("STOCKS").Activate 'Activate sheet
    Range("A3").Select 'Select top of column
    Selection.End(xlDown).Select 'Find bottom of column
    LastR = ActiveCell.Row 'Get row number

  2. #2
    Forum Contributor colofnature's Avatar
    Join Date
    05-11-2006
    Location
    -
    MS-Off Ver
    -
    Posts
    301
    Integer data types have a limited size, and 65536, the last row on a worksheet, exceeds that limit. Try using the Long data type instead - similar to integers, but way bugger...

    Col
    If you give someone a program, you will frustrate them for a day; if you teach them how to program, you will frustrate them for a lifetime.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1