+ Reply to Thread
Results 1 to 8 of 8

Conditional macros

  1. #1
    Forum Contributor
    Join Date
    01-14-2020
    Location
    Pakistan
    MS-Off Ver
    15
    Posts
    123

    Conditional macros

    Hi,

    Is it possible for macro to run only if the other macro has been run fully ? I’ve multiple command button set in a worksheet, 1 to print AJ’s another one to clear all contents, is it possible for clear all contents macro should only work when print macro has been called fully. If print macro hasn’t been run fully then message box appears for the user to print documents first.

    Thank you in advance.

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,266

    Re: Conditional macros

    ??? e.g.:
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    01-14-2020
    Location
    Pakistan
    MS-Off Ver
    15
    Posts
    123

    Re: Conditional macros

    Thank you - it’s not working for some reason
    Let me try and explain in detail

    Macro 1 is - print document
    Macro 2 is - clear document

    Both working fine - but I want to macro 2 to check if macro 1 has run fully before clearing the document. If macro 1 not run fully then stop the process and show message box.

    Thank you

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Conditional macros

    Is Macro 2 always clear after Macro 1?

    If so
    Make Macro 2 as Private and run Macro 2 from Macro 1 after the print.

  5. #5
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,266

    Re: Conditional macros

    Quote Originally Posted by samarbac View Post
    ... I want to macro 2 to check if macro 1 has run fully ...
    That's how it works.
    If the variable "prmsn" does not get the value "True" (prmsn = True) when executing "procedure_1", then "procedure_2" will not be executed.

    Quote Originally Posted by samarbac View Post
    it’s not working for some reason
    Give an example of your procedures.

  6. #6
    Forum Contributor
    Join Date
    01-14-2020
    Location
    Pakistan
    MS-Off Ver
    15
    Posts
    123

    Re: Conditional macros

    Hi

    Thank you for the message- here is my 2 macros : I want 2nd macro to only works if 1st macro of PDF has fully run :

    Macro One :

    Please Login or Register  to view this content.

    2nd Macro


    Please Login or Register  to view this content.
    Thank you

  7. #7
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,266

    Re: Conditional macros

    Try:
    Please Login or Register  to view this content.
    Last edited by mjr veverka; 06-07-2020 at 11:06 AM.

  8. #8
    Forum Contributor
    Join Date
    01-14-2020
    Location
    Pakistan
    MS-Off Ver
    15
    Posts
    123

    Re: Conditional macros

    Hi

    thank you for the reply.

    Unfortunately, it's not doing anything - like when I try and save PDF - it brings up windows for location and when click save - it doesn't save. Also, when click on Newday macro it shows the message box of procedure not completed fully and then that's it.

+ 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. Conditional Formating and Macros
    By ashley72788 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-12-2016, 03:57 PM
  2. Conditional Macros
    By DragonRulerX in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-15-2015, 11:04 AM
  3. [SOLVED] Conditional formatting or macros or vba?
    By lcartwright in forum Excel General
    Replies: 2
    Last Post: 08-07-2014, 06:28 PM
  4. [SOLVED] Conditional formatting + macros
    By helpplease344 in forum Excel General
    Replies: 4
    Last Post: 05-16-2014, 03:42 PM
  5. [SOLVED] Macros and conditional formatting
    By skalus in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-25-2013, 08:38 AM
  6. [SOLVED] Help with Macros and/or Conditional Formatting.
    By Inez15 in forum Excel General
    Replies: 5
    Last Post: 11-08-2012, 01:11 PM
  7. Conditional Formatting And Macros
    By Dominic_Hodgson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-04-2007, 05:33 AM

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