+ Reply to Thread
Results 1 to 8 of 8

OVerflow 6 error

  1. #1
    Registered User
    Join Date
    10-10-2012
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2007/2010
    Posts
    28

    Question OVerflow 6 error

    Hi guys,

    Pretty novice when it comes to VBA so go easy :D

    Trying to write a rather simple comparison tool. Im using userforms. See screen shots

    So far this is how far I got.

    Show the userform, click on trench then click next. goes to userform 2. Works as intended when I click all. It's when I try to select more then one check box that gives me an overflow error.

    Code:

    Please Login or Register  to view this content.
    is part of the code where check box 1 and 5 are checked that's not calculating.

    Thanks in advance guys.

    PS: If someone can let me know a quicker way to clear cells colours I would be appreciative.
    Attached Images Attached Images

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: OVerflow 6 error

    To clear the color, replace this...

    Please Login or Register  to view this content.
    With this...
    Please Login or Register  to view this content.
    I don't follow the rest of your code understand the error.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: OVerflow 6 error

    Where do you get the overflow error?

    Is it on a line like this?
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    10-10-2012
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2007/2010
    Posts
    28

    Re: OVerflow 6 error

    Yes Norie. It only happens when I have more then one checkbox checked.

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: OVerflow 6 error

    I think that basically means that the error is caused by Count being 0.

    Why it's 0 is hard to tell without seeing some data.

    Could you upload a sample workbook?

    Might also help if you could post some info on what the trenching userform is meant to do.

  6. #6
    Registered User
    Join Date
    10-10-2012
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2007/2010
    Posts
    28

    Re: OVerflow 6 error

    Yea I can't figure out why it was doing that either. But anyway I have slightly changed the way I do what I want. Here is the spreadsheet.

    Trenching Form will calculate the average for projects won/ lost.

    I need to do some more work and make it a bit more automated with regards to choosing the cells. Currently I select the cell manually in the code. But I'll figure out how to select the cell with "Won" / "Lost"

    Sorry, the spreadsheet is all over the place, so is the userforms. But, this is work in progress..

    Thank you for your help guys (Nories/ AlphaFrog). Much appreciated.

    Keep up the good work guys!
    Attached Files Attached Files

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: OVerflow 6 error

    You have no worksheet references in the code where the error occurs.

    That means that VBA will look at whatever sheet is active when you use things like Cells/Range etc.

    Which sheet should it be looking at?

    Looking at the rest of the code it's Sheet1 so try this.
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    10-10-2012
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2007/2010
    Posts
    28

    Re: OVerflow 6 error

    Thank you for the help Norie! Much appreciated! Great forum!

    Keep up the good work

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Explanation of the Run-time error '6': Overflow Error
    By mgphill in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2012, 10:46 AM
  2. Want to do a while-loop but get error message: run error '6' overflow
    By danzi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-07-2011, 01:48 PM
  3. Overflow Error
    By transparencia in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-25-2010, 02:21 PM
  4. Overflow error
    By Grd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-21-2006, 04:20 AM
  5. Overflow error
    By Jim Berglund in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-30-2005, 02:06 PM

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