{"id":2144,"date":"2023-09-28T23:53:52","date_gmt":"2023-09-28T23:53:52","guid":{"rendered":"https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/"},"modified":"2023-12-06T05:49:36","modified_gmt":"2023-12-06T05:49:36","slug":"de-datum-van-vandaag-huidige-tijd","status":"publish","type":"page","link":"https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/","title":{"rendered":"Hoe krijg ik de huidige datum en tijd?"},"content":{"rendered":"<div class=\"excel-voor-de-inhoud\" id=\"excel-1932103153\"><script type=\"text\/javascript\">\r\n\tatOptions = {\r\n\t\t'key' : 'c1158f160081d6540a8409e6925dab94',\r\n\t\t'format' : 'iframe',\r\n\t\t'height' : 250,\r\n\t\t'width' : 300,\r\n\t\t'params' : {}\r\n\t};\r\n<\/script>\r\n<script type=\"text\/javascript\" src=\"\/\/www.highperformanceformat.com\/c1158f160081d6540a8409e6925dab94\/invoke.js\"><\/script><\/div> <p>In deze zelfstudie leren we verschillende manieren om de datum en tijd van vandaag te verkrijgen met behulp van VBA-code.<\/p><h2 class=\"wp-block-heading\"> De datum van vandaag in VBA<\/h2><p> In VBA is er een functie genaamd &#8221; <a href=\"https:\/\/exceladvisor.org\/nl\/datum-2\/\">DATUM<\/a> &#8221; die u kunt gebruiken om de huidige datum te verkrijgen. Wanneer u deze functie gebruikt, retourneert deze, net als in het volgende voorbeeld, de huidige datum op basis van de systeemdatuminstelling.<\/p><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\"><strong>Sub<\/strong> myMacro() Range(\"A1\") = Date <strong>End<\/strong> <strong>Sub<\/strong><\/code><\/pre><p> Wanneer u <a href=\"https:\/\/exceladvisor.org\/nl\/voer-een-macro-uit-2\/\">deze code uitvoert<\/a> , wordt de huidige datum in cel A1 ingevoerd en wordt de huidige datumnotatie gebruikt die u in Excel heeft. <\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-61123\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-date-daujourdhui-en-vba.png\" sizes=\"auto, \" srcset=\"\" alt=\"de datum-van vandaag in vba\" width=\"448\" height=\"451\"><\/figure><\/div><p> U kunt deze functie ook gebruiken om de datum van vandaag in een <a href=\"https:\/\/exceladvisor.org\/nl\/vba-berichtbox\/\">berichtenvenster<\/a> te krijgen, net als de volgende code.<\/p><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\"><strong>Sub<\/strong> myMacro() MsgBox Date <strong>End<\/strong> <strong>Sub<\/strong><\/code><\/pre><h2 class=\"wp-block-heading\"> De datum van vandaag en de huidige tijd<\/h2><p> Op dezelfde manier is er een functie genaamd &#8221; <a href=\"https:\/\/exceladvisor.org\/nl\/nu\/\">NU<\/a> &#8221; die u kunt gebruiken om de datum en tijd van vandaag op te halen. Zoals u kunt zien, hebben we dit in de volgende code gebruikt om de huidige datum en tijd in cel A1 op te halen. <\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-61124\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/2-date-daujourdhui-et-heure-actuelle.png\" sizes=\"auto, \" srcset=\"\" alt=\"huidige-datum-en-huidige-tijd\" width=\"450\" height=\"429\"><\/figure><\/div><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\"><strong>Sub<\/strong> myMacro() Range(\"A1\") = Now <strong>End<\/strong> <strong>Sub<\/strong><\/code><\/pre><h2 class=\"wp-block-heading\"> Huidig uur<\/h2><p> Als u nu alleen de huidige tijd wilt zien in plaats van datum en tijd, moet u een andere functie &#8220;Formatteren&#8221; gebruiken ( <a href=\"https:\/\/exceladvisor.org\/nl\/formaat\/\">u kunt hier meer over deze functie lezen<\/a> ) samen met de nu-functie. <\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-61125\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/3-heure-actuelle.png\" sizes=\"auto, \" srcset=\"\" alt=\"huidig uur\" width=\"585\" height=\"388\"><\/figure><\/div><p> In de bovenstaande code hebben we de nu-functie gebruikt om de waarde van de format-functie op te geven en vervolgens een format voor alleen tijd gebruikt.<\/p><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Sub myMacro() Range(\"A1\") = Format( <strong>Now<\/strong> , \"HH:MM Am\/Pm\") End Sub<\/code><\/pre><h2 class=\"wp-block-heading\"> Het formaat van de datum van vandaag wijzigen (bijvoorbeeld: JJJJMMDD)<\/h2><p> U kunt ook de formaatfunctie gebruiken om het formaat van de huidige datum te wijzigen. In de volgende code hebben we de formaatfunctie gebruikt en het formaat gespecificeerd als \u201cJJJJMMDD\u201d.<\/p><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Sub myMacro() <strong>Range<\/strong> (\"A1\"). <strong>Value<\/strong> = <strong>Format<\/strong> ( <strong>Date<\/strong> , \"YYYY\/MM\/DD\") <strong>End<\/strong> Sub<\/code><\/pre><p class=\"qt-tip\"> Opmerking: in de bovenstaande code hebben we de eigenschap value gebruikt om de datum in cel A1 in te voeren. <\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-61126\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/4-format-de-date-daujourdhui.png\" sizes=\"auto, \" srcset=\"\" alt=\"datumnotatie van vandaag\" width=\"613\" height=\"333\"><\/figure><\/div><div class=\"gb-container gb-container-4db6181c gb-container-mt\"> <a class=\"gb-button gb-button-c5897111 gb-button-text gb-button-mt-button\" href=\"https:\/\/exceladvisor.org\/nl\/vba\/\">Wat is VBA<\/a><h2 class=\"gb-headline gb-headline-665e5f6b gb-headline-text gb-headline-mt-heading\"> Gerelateerde tutorials <\/h2><div class=\"gb-grid-wrapper gb-grid-wrapper-a20baf7c gb-grid-wrapper-mt-grid\"><div class=\"gb-grid-column gb-grid-column-65ddf67e\"><div class=\"gb-container gb-container-65ddf67e\"><ul><li> <a href=\"https:\/\/exceladvisor.org\/nl\/gemiddeld-2\/\">Gemiddelde waarden in Excel met VBA<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/nl\/som-1\/\">Somwaarden op in Excel met VBA<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/nl\/wedstrijd-2\/\">Match-functie in VBA<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/nl\/willekeurig-nummer\/\">VBA willekeurige getallen<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/nl\/berekenen\/\">VBA-berekening<\/a> <\/li><\/ul><\/div><\/div><div class=\"gb-grid-column gb-grid-column-50067b57\"><div class=\"gb-container gb-container-50067b57\"><\/div><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"ub_ctt_via":"","footnotes":""},"class_list":["post-2144","page","type-page","status-publish","hentry"],"featured_image_src":null,"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u25b7 Hoe krijg ik de huidige datum en tijd via VBA?<\/title>\n<meta name=\"description\" content=\"In deze tutorial leren we hoe we de datum van vandaag en de huidige tijd uit een VBA kunnen halen. In VBA is er een functie\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/\" \/>\n<meta property=\"og:locale\" content=\"nl_NL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u25b7 Hoe krijg ik de huidige datum en tijd via VBA?\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial leren we hoe we de datum van vandaag en de huidige tijd uit een VBA kunnen halen. In VBA is er een functie\" \/>\n<meta property=\"og:url\" content=\"https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/\" \/>\n<meta property=\"og:site_name\" content=\"Excel Advisor\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-06T05:49:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-date-daujourdhui-en-vba.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Geschatte leestijd\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/\",\"url\":\"https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/\",\"name\":\"\u25b7 Hoe krijg ik de huidige datum en tijd via VBA?\",\"isPartOf\":{\"@id\":\"https:\/\/exceladvisor.org\/nl\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-date-daujourdhui-en-vba.png\",\"datePublished\":\"2023-09-28T23:53:52+00:00\",\"dateModified\":\"2023-12-06T05:49:36+00:00\",\"description\":\"In deze tutorial leren we hoe we de datum van vandaag en de huidige tijd uit een VBA kunnen halen. In VBA is er een functie\",\"breadcrumb\":{\"@id\":\"https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/#breadcrumb\"},\"inLanguage\":\"nl-NL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"nl-NL\",\"@id\":\"https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/#primaryimage\",\"url\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-date-daujourdhui-en-vba.png\",\"contentUrl\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-date-daujourdhui-en-vba.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/exceladvisor.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hoe krijg ik de huidige datum en tijd?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/exceladvisor.org\/nl\/#website\",\"url\":\"https:\/\/exceladvisor.org\/nl\/\",\"name\":\"Excel Advisor\",\"description\":\"Uw gids voor datadominantie\",\"publisher\":{\"@id\":\"https:\/\/exceladvisor.org\/nl\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/exceladvisor.org\/nl\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"nl-NL\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/exceladvisor.org\/nl\/#organization\",\"name\":\"Excel Advisor\",\"url\":\"https:\/\/exceladvisor.org\/nl\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"nl-NL\",\"@id\":\"https:\/\/exceladvisor.org\/nl\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/exceladvisor.org\/nl\/wp-content\/uploads\/2023\/12\/exceladvisor.org_.png\",\"contentUrl\":\"https:\/\/exceladvisor.org\/nl\/wp-content\/uploads\/2023\/12\/exceladvisor.org_.png\",\"width\":105,\"height\":36,\"caption\":\"Excel Advisor\"},\"image\":{\"@id\":\"https:\/\/exceladvisor.org\/nl\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u25b7 Hoe krijg ik de huidige datum en tijd via VBA?","description":"In deze tutorial leren we hoe we de datum van vandaag en de huidige tijd uit een VBA kunnen halen. In VBA is er een functie","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:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/","og_locale":"nl_NL","og_type":"article","og_title":"\u25b7 Hoe krijg ik de huidige datum en tijd via VBA?","og_description":"In deze tutorial leren we hoe we de datum van vandaag en de huidige tijd uit een VBA kunnen halen. In VBA is er een functie","og_url":"https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/","og_site_name":"Excel Advisor","article_modified_time":"2023-12-06T05:49:36+00:00","og_image":[{"url":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-date-daujourdhui-en-vba.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Geschatte leestijd":"2 minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/","url":"https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/","name":"\u25b7 Hoe krijg ik de huidige datum en tijd via VBA?","isPartOf":{"@id":"https:\/\/exceladvisor.org\/nl\/#website"},"primaryImageOfPage":{"@id":"https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/#primaryimage"},"image":{"@id":"https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/#primaryimage"},"thumbnailUrl":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-date-daujourdhui-en-vba.png","datePublished":"2023-09-28T23:53:52+00:00","dateModified":"2023-12-06T05:49:36+00:00","description":"In deze tutorial leren we hoe we de datum van vandaag en de huidige tijd uit een VBA kunnen halen. In VBA is er een functie","breadcrumb":{"@id":"https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/#breadcrumb"},"inLanguage":"nl-NL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/"]}]},{"@type":"ImageObject","inLanguage":"nl-NL","@id":"https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/#primaryimage","url":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-date-daujourdhui-en-vba.png","contentUrl":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-date-daujourdhui-en-vba.png"},{"@type":"BreadcrumbList","@id":"https:\/\/exceladvisor.org\/nl\/de-datum-van-vandaag-huidige-tijd\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/exceladvisor.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Hoe krijg ik de huidige datum en tijd?"}]},{"@type":"WebSite","@id":"https:\/\/exceladvisor.org\/nl\/#website","url":"https:\/\/exceladvisor.org\/nl\/","name":"Excel Advisor","description":"Uw gids voor datadominantie","publisher":{"@id":"https:\/\/exceladvisor.org\/nl\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/exceladvisor.org\/nl\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"nl-NL"},{"@type":"Organization","@id":"https:\/\/exceladvisor.org\/nl\/#organization","name":"Excel Advisor","url":"https:\/\/exceladvisor.org\/nl\/","logo":{"@type":"ImageObject","inLanguage":"nl-NL","@id":"https:\/\/exceladvisor.org\/nl\/#\/schema\/logo\/image\/","url":"https:\/\/exceladvisor.org\/nl\/wp-content\/uploads\/2023\/12\/exceladvisor.org_.png","contentUrl":"https:\/\/exceladvisor.org\/nl\/wp-content\/uploads\/2023\/12\/exceladvisor.org_.png","width":105,"height":36,"caption":"Excel Advisor"},"image":{"@id":"https:\/\/exceladvisor.org\/nl\/#\/schema\/logo\/image\/"}}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/pages\/2144","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/comments?post=2144"}],"version-history":[{"count":1,"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/pages\/2144\/revisions"}],"predecessor-version":[{"id":2631,"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/pages\/2144\/revisions\/2631"}],"wp:attachment":[{"href":"https:\/\/exceladvisor.org\/nl\/wp-json\/wp\/v2\/media?parent=2144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}