+ Reply to Thread
Results 1 to 6 of 6

VBA that looks for any negative numbers in columns and displays message box if True

  1. #1
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,472

    VBA that looks for any negative numbers in columns and displays message box if True

    I am currently struggling trying to make a Macro that looks for any negative numbers in only columns P and Q. If it finds a negative number in either of those columns I want it to display a message box "Error Negative Number".

    I appreciate the help.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA that looks for any negative numbers in columns and displays message box if True

    Try this:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: VBA that looks for any negative numbers in columns and displays message box if True

    Why not just use data validation. You can have it either prevent entering negative numbers or provide a warning dialog but allow their entry and customize the dialog text however you like. Seems to be a much simplier way to accomplish the singular goal.
    Ways to get help: Post clear questions, explain your overall goal, supply as much background as possible, respond to questions asked of you by those trying to help and post sample(s) files.

    "I am here to help, not do it for people" -Me

  4. #4
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,472

    Re: VBA that looks for any negative numbers in columns and displays message box if True

    Welp after posting i continued working on this and ended up figuring it out:
    Please Login or Register  to view this content.

  5. #5
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,472

    Re: VBA that looks for any negative numbers in columns and displays message box if True

    @xladept

    thank you for your response, i just saw it.

    @zer0

    I am making a long macro so that someone can just click a button on a preexisting monthly data dump.
    thank you for your response.

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA that looks for any negative numbers in columns and displays message box if True

    You're welcome and thanks for the rep!

+ 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. [SOLVED] splitting positive and negative numbers from 2 column to 2 columns
    By Megatronixs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2016, 06:31 AM
  2. [SOLVED] If Statement that displays a text from a cell if True
    By NZL_Truly in forum Excel General
    Replies: 1
    Last Post: 02-17-2015, 03:17 AM
  3. Sort negative and positive numbers into their own columns?
    By More Cowbell in forum Excel General
    Replies: 6
    Last Post: 01-31-2015, 02:57 PM
  4. I need to edit my formula so it displays every second true result
    By PatAlex in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-18-2013, 07:19 AM
  5. Replies: 3
    Last Post: 04-09-2012, 02:53 PM
  6. [SOLVED] formula for negative and positive numbers in different columns
    By s.m.hardin in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-29-2005, 03:10 PM
  7. Text Columns Negative Numbers Upgrade Excel?
    By Dust Bun in forum Excel General
    Replies: 1
    Last Post: 07-22-2005, 02:05 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