+ Reply to Thread
Results 1 to 2 of 2

Run-time error '6': Overflow

  1. #1
    Registered User
    Join Date

    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':

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

    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
    MS-Off Ver
    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...

    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)


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