+ Reply to Thread
Results 1 to 17 of 17

Check range A10 to A45 and if cell not empty then same line in B must have value

Hybrid View

  1. #1
    Registered User
    Join Date
    03-08-2013
    Location
    Norfolk
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Check range A10 to A45 and if cell not empty then same line in B must have value

    Works wonderfully mate.

    I have taken a look at the code and can't even see where does the macro see the value higher that 0.

    I was expecting something like >0 somewhere along any line of code.

    As you have managed this and I can't really ask for more as it is working as wanted to, how would you go about referring to the content of the cell in A when displaying the inputBox?

    I mean right now it indicates which cell needs a value but instead of this for example;

    A10= bag of potatoes B10=empty no value here.

    inputBox and msgBox display both B10 as reference.

    How would you code this to display Enter number for bag of potatoes. and you must enter a quantity for a bag of potatoes.

    Sorry to be a pain.

    But I just think this so intriguing man.

    Cheers.
    Albert

  2. #2
    Forum Contributor
    Join Date
    07-16-2012
    Location
    Ontario Canada
    MS-Off Ver
    Excel 2010
    Posts
    124

    Re: Check range A10 to A45 and if cell not empty then same line in B must have value

    Change to
    MyNum = Application.InputBox("Enter Quantity for " & rCell.Value)

    Also, right now, if you enter a non number in the Input Box, like a letter, then you get the message box but it doesnt stop the macro.
    If you want the Macro to stop, then you need an "Exit Sub":

                    If IsNumeric(MyNum) = False Then
                        MsgBox ("You must enter a numeric value in " & rCell.Offset(0, 1).Address(False, False))
                        rCell.Offset(0, 1).Select
                        Exit Sub
                    Else

+ 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