{"id":12077,"date":"2011-11-04T21:13:40","date_gmt":"2011-11-04T21:13:40","guid":{"rendered":"http:\/\/www.learnexcelmacro.com\/?p=257"},"modified":"2011-11-04T21:13:40","modified_gmt":"2011-11-04T21:13:40","slug":"sleep-wait-delay-function","status":"publish","type":"post","link":"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/","title":{"rendered":"Wait Function"},"content":{"rendered":"

Even more wait for Gane of thrones New Season??? Noooo !!! Who in real life would like to wait… especially for Game Of Thrones \ud83d\ude00 No one would like to wait for any thing in real life \ud83d\ude42
\n

\"Waiting<\/a>

Waiting For Game Of Thrones Season – 7<\/p><\/div><\/p>\n

Sometimes, while doing Automation in Excel Macro we require a “Wait” or “Sleep” function, which will hold the execution of the next statements until the specified time.<\/p>\n

Following is the Syntax, of Wait function in Excel VBA (Macro):<\/p>\n\n\n
\nApplication.Wait   <\/font><\/strong> <Time><\/td>\n<\/tr>\n<\/table>\n

Here Time should be in this format : HH:MM:SS<\/strong><\/p>\n

Example:<\/strong>
\nBelow code will pause the Macro running till 1:45 PM<\/p>\n\n\n
Application.Wait “13:45:00”<\/font>\n<\/td>\n<\/td>\n<\/table>\n

Now if want to pause the Macro for few hours, minutes or seconds then we can use DateAdd() Function<\/a><\/strong> in Application.Wait function.
\nExample:<\/strong><\/p>\n\n\n
Application.Wait DateAdd(“s”, 3, Now)<\/font><\/td>\n<\/tr>\n<\/table>\n

In the above example, Macro will be paused for 3 Seconds.<\/p>\n

For 3 minutes: <\/p>\n\n\n
Application.Wait DateAdd(“n”, 3, Now)<\/font><\/td>\n<\/tr>\n<\/table>\n

Note:<\/strong> For Minute we should use <\/i> “n”<\/strong> not <\/i>“m”<\/strong>. “m”<\/strong> is for Month. For more details click here<\/a><\/i>
\nSimilarly for 3 hrs:<\/p>\n\n\n
Application.Wait DateAdd(“h”, 3, Now)<\/font><\/td>\n<\/tr>\n<\/table>\n

<\/p>\n<\/span>","protected":false},"excerpt":{"rendered":"

Even more wait for Gane of thrones New Season??? Noooo !!! Who in real life would like to wait… especially for Game Of Thrones \ud83d\ude00 No one would like to wait for any thing in real life \ud83d\ude42 Sometimes, while doing Automation in Excel Macro we require a “Wait” or “Sleep” function, which will hold […]<\/p>\n","protected":false},"author":45,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[1672,1673],"tags":[],"class_list":["post-12077","post","type-post","status-publish","format-standard","hentry","category-excel-formula","category-excel-functions"],"yoast_head":"\nHold your Program execution by using Wait() or Sleep() function in Excel VBA<\/title>\n<meta name=\"description\" content=\"In VBA Application.Wait is same as Sleep function. Instead of using Sleep function, we can use Application.Wait function in VBA. It puts all the processes on hold for the specified time period and then move to the next.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Wait Function\" \/>\n<meta property=\"og:description\" content=\"In VBA Application.Wait is same as Sleep function. Instead of using Sleep function, we can use Application.Wait function in VBA. It puts all the processes on hold for the specified time period and then move to the next.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/\" \/>\n<meta property=\"og:site_name\" content=\"Let's excel in Excel\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/vmlogger\" \/>\n<meta property=\"article:author\" content=\"http:\/\/www.facebook.com\/vmlogger\" \/>\n<meta property=\"article:published_time\" content=\"2011-11-04T21:13:40+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/learnexcelmacro.com\/wp\/wp-content\/uploads\/sites\/11\/2011\/11\/waiting-for-game-of-thrones-season.jpg\" \/>\n<meta name=\"author\" content=\"Vishwamitra Mishra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/www.twitter.com\/learnexcelmacro\" \/>\n<meta name=\"twitter:site\" content=\"@learnexcelmacro\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vishwamitra Mishra\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/\"},\"author\":{\"name\":\"Vishwamitra Mishra\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"headline\":\"Wait Function\",\"datePublished\":\"2011-11-04T21:13:40+00:00\",\"dateModified\":\"2011-11-04T21:13:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/\"},\"wordCount\":190,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"image\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2011\/11\/waiting-for-game-of-thrones-season.jpg\",\"articleSection\":[\"Excel Formula\",\"Excel Functions\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/\",\"url\":\"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/\",\"name\":\"Hold your Program execution by using Wait() or Sleep() function in Excel VBA\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2011\/11\/waiting-for-game-of-thrones-season.jpg\",\"datePublished\":\"2011-11-04T21:13:40+00:00\",\"dateModified\":\"2011-11-04T21:13:40+00:00\",\"description\":\"In VBA Application.Wait is same as Sleep function. Instead of using Sleep function, we can use Application.Wait function in VBA. It puts all the processes on hold for the specified time period and then move to the next.\",\"breadcrumb\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/#primaryimage\",\"url\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2011\/11\/waiting-for-game-of-thrones-season.jpg\",\"contentUrl\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2011\/11\/waiting-for-game-of-thrones-season.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/vmlogger.com\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Excel Formula\",\"item\":\"https:\/\/vmlogger.com\/excel\/excel-formula\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Wait Function\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#website\",\"url\":\"https:\/\/vmlogger.com\/excel\/\",\"name\":\"Let's excel in Excel\",\"description\":\"Let's share knowledge\",\"publisher\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/vmlogger.com\/excel\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\",\"name\":\"Vishwamitra Mishra\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png\",\"contentUrl\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png\",\"width\":528,\"height\":560,\"caption\":\"Vishwamitra Mishra\"},\"logo\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/\"},\"description\":\"My name is Vishwamitra Mishra. Friends Call me Vishwa. I hold a Bachelor\u2019s Degree in Computer Science from D.A.V.V. Indore & currently working as a Technical Lead having over 7 years of experience.\",\"sameAs\":[\"http:\/\/www.learnexcelmacro.com\",\"http:\/\/www.facebook.com\/vmlogger\",\"https:\/\/x.com\/https:\/\/www.twitter.com\/learnexcelmacro\",\"https:\/\/www.youtube.com\/c\/VMLogger\"],\"url\":\"https:\/\/vmlogger.com\/excel\/author\/vishwamitra\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Hold your Program execution by using Wait() or Sleep() function in Excel VBA","description":"In VBA Application.Wait is same as Sleep function. Instead of using Sleep function, we can use Application.Wait function in VBA. It puts all the processes on hold for the specified time period and then move to the next.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/","og_locale":"en_US","og_type":"article","og_title":"Wait Function","og_description":"In VBA Application.Wait is same as Sleep function. Instead of using Sleep function, we can use Application.Wait function in VBA. It puts all the processes on hold for the specified time period and then move to the next.","og_url":"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/","og_site_name":"Let's excel in Excel","article_publisher":"http:\/\/www.facebook.com\/vmlogger","article_author":"http:\/\/www.facebook.com\/vmlogger","article_published_time":"2011-11-04T21:13:40+00:00","og_image":[{"url":"http:\/\/learnexcelmacro.com\/wp\/wp-content\/uploads\/sites\/11\/2011\/11\/waiting-for-game-of-thrones-season.jpg"}],"author":"Vishwamitra Mishra","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/www.twitter.com\/learnexcelmacro","twitter_site":"@learnexcelmacro","twitter_misc":{"Written by":"Vishwamitra Mishra","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/#article","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/"},"author":{"name":"Vishwamitra Mishra","@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"headline":"Wait Function","datePublished":"2011-11-04T21:13:40+00:00","dateModified":"2011-11-04T21:13:40+00:00","mainEntityOfPage":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/"},"wordCount":190,"commentCount":0,"publisher":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"image":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/#primaryimage"},"thumbnailUrl":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2011\/11\/waiting-for-game-of-thrones-season.jpg","articleSection":["Excel Formula","Excel Functions"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/","url":"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/","name":"Hold your Program execution by using Wait() or Sleep() function in Excel VBA","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/#website"},"primaryImageOfPage":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/#primaryimage"},"image":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/#primaryimage"},"thumbnailUrl":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2011\/11\/waiting-for-game-of-thrones-season.jpg","datePublished":"2011-11-04T21:13:40+00:00","dateModified":"2011-11-04T21:13:40+00:00","description":"In VBA Application.Wait is same as Sleep function. Instead of using Sleep function, we can use Application.Wait function in VBA. It puts all the processes on hold for the specified time period and then move to the next.","breadcrumb":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/#primaryimage","url":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2011\/11\/waiting-for-game-of-thrones-season.jpg","contentUrl":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2011\/11\/waiting-for-game-of-thrones-season.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/vmlogger.com\/excel\/2011\/11\/sleep-wait-delay-function\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vmlogger.com\/excel\/"},{"@type":"ListItem","position":2,"name":"Excel Formula","item":"https:\/\/vmlogger.com\/excel\/excel-formula\/"},{"@type":"ListItem","position":3,"name":"Wait Function"}]},{"@type":"WebSite","@id":"https:\/\/vmlogger.com\/excel\/#website","url":"https:\/\/vmlogger.com\/excel\/","name":"Let's excel in Excel","description":"Let's share knowledge","publisher":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vmlogger.com\/excel\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5","name":"Vishwamitra Mishra","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/","url":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png","contentUrl":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png","width":528,"height":560,"caption":"Vishwamitra Mishra"},"logo":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/"},"description":"My name is Vishwamitra Mishra. Friends Call me Vishwa. I hold a Bachelor\u2019s Degree in Computer Science from D.A.V.V. Indore & currently working as a Technical Lead having over 7 years of experience.","sameAs":["http:\/\/www.learnexcelmacro.com","http:\/\/www.facebook.com\/vmlogger","https:\/\/x.com\/https:\/\/www.twitter.com\/learnexcelmacro","https:\/\/www.youtube.com\/c\/VMLogger"],"url":"https:\/\/vmlogger.com\/excel\/author\/vishwamitra\/"}]}},"_links":{"self":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts\/12077"}],"collection":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/comments?post=12077"}],"version-history":[{"count":0,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts\/12077\/revisions"}],"wp:attachment":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/media?parent=12077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/categories?post=12077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/tags?post=12077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}