+ Reply to Thread
Results 1 to 5 of 5

If time is 8am to 1pm then run macro1 otherwise run marcro2

  1. #1
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    If time is 8am to 1pm then run macro1 otherwise run marcro2

    hi,
    i want to run my macro according to time change

    i need if the time is 8am - 1pm and 4pm - 5 pm then run macro1 otherwise run macro2


    thank you
    Use Code-Tags for showing your code :
    Please mark your question Solved if there has been offered a solution that works fine for you
    If You like solutions provided by anyone, feel free to add reputation using STAR *

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: If time is 8am to 1pm then run macro1 otherwise run marcro2

    Hi HaroonSid- Try this:
    Please Login or Register  to view this content.
    You didn't say HOW you wanted the TEST triggered. Workbook_Open, Workbook_Save, and Worksheet_Change are some of the events you could use, or you could trigger it manually from a button, or from other code. Lots of options. Let me know if you need me to fine tune the code.

    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 06-10-2017 at 01:46 AM.

  3. #3
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: If time is 8am to 1pm then run macro1 otherwise run marcro2

    Thank you leelnich

    i will try this surely

  4. #4
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: If time is 8am to 1pm then run macro1 otherwise run marcro2

    its working perfect

  5. #5
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: If time is 8am to 1pm then run macro1 otherwise run marcro2

    Great! Glad I could help, thank you for the rep.

+ 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. Replies: 1
    Last Post: 03-10-2016, 12:40 PM
  2. [SOLVED] simplest way of using result of macro1 in macro 2
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-31-2016, 03:52 PM
  3. If the time is after 7 then <Macro1> if the time is before 7 then <macro2>
    By Jenkins27 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-17-2015, 12:22 PM
  4. How can I decrease Macro1 running time ? (Copy and paste values issue)
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-20-2014, 07:30 PM
  5. [SOLVED] Run macro1 automatically when a specific cell value changes
    By ddawson7 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-15-2012, 01:39 PM
  6. importing data:Sub Macro1()
    By Sergei D in forum Excel General
    Replies: 0
    Last Post: 07-31-2006, 12:48 PM
  7. [SOLVED] Delete Unwanted Macro1 Sheet
    By keithb in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-08-2005, 02:05 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