+ Reply to Thread
Results 1 to 5 of 5

VBA IF OR AND statement overflow error

  1. #1
    Registered User
    Join Date
    09-07-2011
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    38

    VBA IF OR AND statement overflow error

    Fellas,

    I am having a trouble with a macro and would very much appreciate your help.

    my structre is:

    Column 1 31 columns in the middle Column 33, aka cols4
    PH some data Y
    some data

    The code is in worksheert_change sub.

    Please Login or Register  to view this content.
    What I want the code to do is upon a change of sheet (i have set it to 'upon change in a specific range'), for each row, if column 33 is Y and column one (33 - 32) is either "PH" or "", undo the action an sho msgbox.

    Not sure why I am getting overflow error.

    Any help is much appreciated!

    Cheers!

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: VBA IF OR AND statement overflow error

    Where does the overflow occur?
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    09-07-2011
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: VBA IF OR AND statement overflow error

    this line:
    Please Login or Register  to view this content.

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: VBA IF OR AND statement overflow error

    Does it help if you use:
    Please Login or Register  to view this content.
    Do you have any cells formatted as Date that have large numbers in them?

  5. #5
    Registered User
    Join Date
    09-07-2011
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: VBA IF OR AND statement overflow error

    Thank you! that appears to be working now!

    Indeed I have numbers in billions in that line. Many thanks!

+ 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. 'Overflow' error
    By jamie1985 in forum Access Tables & Databases
    Replies: 5
    Last Post: 08-08-2014, 11:08 AM
  2. Overflow error, can't see why
    By Alexander_V in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-18-2012, 11:57 AM
  3. 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
  4. 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
  5. Msg error (overflow)
    By Mamud in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-25-2011, 10:54 AM

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