+ Reply to Thread
Results 1 to 6 of 6

If condition is <=0 then exit sub or return

  1. #1
    Registered User
    Join Date
    09-11-2008
    Location
    malta
    Posts
    34

    If condition is <=0 then exit sub or return

    I have written the following code. I would like to add code that if user inputs 0 in quantity to be printed, then file is closed without being saved and / or printed;
    Please Login or Register  to view this content.
    Can any one help me please? I know it is a little simple but right now I am stuck.
    Thanks
    Paraxis
    Last edited by royUK; 11-20-2008 at 04:44 AM.

  2. #2
    Registered User
    Join Date
    08-18-2008
    Location
    Singapore
    Posts
    79
    Try:
    Please Login or Register  to view this content.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    paraxis

    Take the time to read the Forum Rules and use Code tags in future
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    09-11-2008
    Location
    malta
    Posts
    34
    Hello Roy,
    Sorry about tags. But I do not know what I have to do to use tags to make my code simpler to digest.
    Please help as I need to ask another question and I have vb code to send on this forum.
    Thanks
    Paraxis

  5. #5
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    When typing up your post you will see a # icon in the text formatting window (Just aove the area you type in), Click on the icon and it will place the word CODE inclosed within square bracket followed by /CODE also inclosed in square brackets. The cusor will appear between ][ brackets.
    This is were all of your VBA code goes.

    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  6. #6
    Registered User
    Join Date
    09-11-2008
    Location
    malta
    Posts
    34

    Question

    Hi Carddards
    I have followed your code which worked well when it was alone. I inserted code in a longer code and when user input 0 as qty and he pressed "No" in pop up window to "Save File" error 400 was generated. The code is as follows:

    Please Login or Register  to view this content.
    I want that when user input is 'n', file is printed for 'n' copies and then saved in the next sequential number. When user input '0' user is prompted that "You chose not to print. File will be saved without being printed' and file is then saved in the next sequential number. Can you help as I have quite a headache with this one.
    10X
    Paraxis

+ 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