+ Reply to Thread
Results 1 to 7 of 7

VBA runtime error '6': Overflow

  1. #1
    Registered User
    Join Date
    06-28-2013
    Location
    London, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    69

    VBA runtime error '6': Overflow

    Need help with my code. I am having issues with my UserForm. The following is code for the 'OK' button (cmdOk). When I run this code I get the error "VBA Runtime Error '6":Overflow".

    The issue is occurring at this line
    Please Login or Register  to view this content.

    When I change the RowCount to be As Long it runs but the data doesn't populate properly (the line of code where the error was). ANy thoughts would be appreciated!


    Please Login or Register  to view this content.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: VBA runtime error '6': Overflow

    declaring as Long is correct. how does it not populate properly?
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    06-28-2013
    Location
    London, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: VBA runtime error '6': Overflow

    Yeah when I have it set to Long I don't get the error but the data that I fill out isn't populating to the sheet. It's very strange because I never had problems before. I did add some fields but that shouldn't have made a difference. Any suggestions for debugging this?

  4. #4
    Registered User
    Join Date
    06-28-2013
    Location
    London, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: VBA runtime error '6': Overflow

    Ok so I made a mistake. The data is populating to the worksheet but for some reason it put the data in cell 1200... I have no data after cell 7 so it should have placed the data in cell 8. Why would it do this?

  5. #5
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: VBA runtime error '6': Overflow

    step through with f8 and watch the sheets. or post the workbook ;-)

  6. #6
    Registered User
    Join Date
    06-28-2013
    Location
    London, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: VBA runtime error '6': Overflow

    So what I did was delete all of the blank cells and cleared their content. Seemed to work. Very annoying bug in Excel though (albeit, it is 2003 version so may not be an issue for people using the new software).

  7. #7
    Registered User
    Join Date
    06-28-2013
    Location
    London, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: VBA runtime error '6': Overflow

    Quote Originally Posted by JosephP View Post
    step through with f8 and watch the sheets. or post the workbook ;-)
    Thanks for the help! I am gonna go ahead and mark this as solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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