+ Reply to Thread
Results 1 to 5 of 5

Automate printing to accept user input options

  1. #1
    Forum Contributor
    Join Date
    03-27-2015
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    147

    Automate printing to accept user input options

    Dear Experts,

    I would like the codes to allow user to choose between 2 printing options :
    option "A" : to print in A3 and in single sheet
    option "B" : to print in A4 and in 2 sheets

    If user chooses "A", then the code shall call up a macro named "X"
    If user chooses "B", then the code shall call up a macro named "Y"

    Note that I have already on hand the coded macro "X" and "Y" to print in A3/A4 and 1/2 sheets.

    It looks simple, but I just don't know the technique.

    Grateful for your kind help in advance.

    Thx & rgds,

    Edward
    Last edited by chasoe; 04-23-2016 at 08:24 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: Automate printing to accept user input options

    There are a few ways you could do this. Here is one. See attached workbook and amend value in B1

    In cell B1 create a data validation dropdown for OptionA and OptionB

    PrintOptions.jpg

    Then put a change event code into the sheet module - this code runs automatically when the value in cell B1 changes. It runs macro X or macro Y based on value in cell B1 and then returns B1 to default value "Select Option"

    Insert this macro in the relevant sheet module
    Please Login or Register  to view this content.
    Attached Files Attached Files
    If a response has helped then please consider rating it by clicking on *Add Reputation below the post
    When your issue has been resolved don't forget to mark the thread SOLVED (click Thread Tools at top of thread)

  3. #3
    Forum Contributor
    Join Date
    03-27-2015
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    147

    Re: Automate printing to accept user input options

    Sorry for late reply, as I've been using my extremely limited vba knowledge to look for other possible ways in the internet other than your suggestion, by cutting and pasting code patches only as I cannot write vba from scratch.

    Please Login or Register  to view this content.

    I've finally completed it but do not know how to remove the "Confirm / Cancell" button in the message boxAttachment 457787. I wish to allow user to only click options from 1 to 5 as listed in the message box and no others. (clicking Confirm / Cancell will show error)

    Appreciate further help.

    Thx a lot.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by chasoe; 04-25-2016 at 11:05 PM. Reason: no image attachment seen

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Automate printing to accept user input options

    change MyInput to String instead of integer

    Please Login or Register  to view this content.
    ps also
    if you do not want 5 to do anything just don't include it as an case in your select instead of making it go thru select process and sub process for no reason
    Last edited by humdingaling; 04-26-2016 at 01:06 AM. Reason: grammar
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  5. #5
    Forum Contributor
    Join Date
    03-27-2015
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    147

    Re: Automate printing to accept user input options

    Thank you. Everything Ok without error message now when clicking "Confirm / Cancell".

    Thanks for all your help.

+ 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. Accept or Reject options when enable macros
    By Formula-seeker in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 06-03-2014, 08:10 PM
  2. How to automate available options from a user selection
    By vicaima in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-05-2012, 08:55 AM
  3. [SOLVED] In copy/pasting cells to a new sheet cannot automate cells (1, x) based on user input
    By CEDarnell in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-05-2012, 06:08 PM
  4. ComboBox to accept user input
    By Robert Woell in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-03-2012, 11:56 AM
  5. Automate formulated rows based on user input
    By G2S in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-01-2012, 10:06 PM
  6. Automate calculation of output based on user input
    By tenn0228 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-02-2009, 06:24 PM
  7. macro window with buttons to accept user input
    By joebelou in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 01-04-2009, 11:57 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