+ Reply to Thread
Results 1 to 5 of 5

What VB Code do I need

  1. #1
    SG
    Guest

    What VB Code do I need

    Excel 2000

    I have a sheet I enter lots of data from check books into. I have many
    Columns and at the end of each Coolum I have a Sum in each cell to check
    that the data was entered correctly.

    Example:

    A1 I would enter ($45.00)
    R1 I would enter $45.00
    In X1 if there is no difference you see the - symbol so I know I entered
    the two numbers correctly. X1 is set up so I know the two numbers match and
    I didn't enter $45.00 in one row and $44.00 in the other.

    After this sheet fills up a bit it takes to much time to scroll down to
    check all these entries. Is there a code I could enter that would display a
    message box telling me X1 had a value other than -. In other words if X1 is
    greater than 0 (zero) I need to know right then so I can make the change as
    I go.

    All the best,
    SG



  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486
    Quote Originally Posted by SG
    Excel 2000


    A1 I would enter ($45.00)
    R1 I would enter $45.00
    In X1 if there is no difference you see the - symbol so I know I entered
    the two numbers correctly. X1 is set up so I know the two numbers match
    All the best,
    SG
    =if(a1+r1=0,"-",a1+r1)

    assuming A1 is a negative value

  3. #3
    JG
    Guest

    Re: What VB Code do I need

    You could put a conditional format on the page based on the value in
    column X so that if the value in a particular row is <> 0, the row will
    turn a color, like red. Just a suggestion to avoid VB if you wanted to.


  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486
    Quote Originally Posted by davesexcel
    =if(a1+r1=0,"-",a1+r1)

    assuming A1 is a negative value

    sorry, I read the message without realizing you wanted a VBA code, but the function will work just as well

  5. #5
    SG
    Guest

    Re: What VB Code do I need

    I don't think the function will work as I need a message box because the
    column that shows any difference may extend waaaaaay to the right of sight
    :>)

    The columns and rows after awhile fill beyond the page site and to work
    around this I use the Data Form which works great but I need a message box
    telling me if Column X or what ever Column my sum is in is different than
    Zero.

    Example Column:
    Column X has the following.......
    =SUM(C2:W2)

    C2 always has a negative number
    The next number could be anywhere between C3-W2 and if I enter anything but
    what's in C2, X2 will show me the difference. I need something to alert me
    the difference if any.

    Thanks for your help....

    All the best,
    SG

    "davesexcel" <[email protected]> wrote
    in message news:[email protected]...
    >
    > davesexcel Wrote:
    >> =if(a1+r1=0,"-",a1+r1)
    >>
    >> assuming A1 is a negative value

    >
    >
    > sorry, I read the message without realizing you wanted a VBA code, but
    > the function will work just as well
    >
    >
    > --
    > davesexcel
    >
    >
    > ------------------------------------------------------------------------
    > davesexcel's Profile:
    > http://www.excelforum.com/member.php...o&userid=31708
    > View this thread: http://www.excelforum.com/showthread...hreadid=541362
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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