{"id":1450,"date":"2015-04-21T15:06:56","date_gmt":"2015-04-21T06:06:56","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=1450"},"modified":"2015-04-21T15:06:56","modified_gmt":"2015-04-21T06:06:56","slug":"timer","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/timer\/","title":{"rendered":"\u65e5\u4ed8\u6642\u523b\uff1a\u7d4c\u904e\u6642\u9593\u3092\u53d6\u5f97\uff08 Timer \u95a2\u6570 \uff09"},"content":{"rendered":"<h2>Timer \u95a2\u6570\u306e\u4f7f\u3044\u65b9<\/h2>\n<br \/>\n<div class=\"m30-l\">\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p><em>result<\/em> = <strong>Timer<\/strong> ()<\/p>\n<\/div>\n<br \/>\n<h3>\u3010\u623b\u308a\u5024\u3011<\/h3>\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>result&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5f53\u65e5\u5348\u524d 0 \u6642\u304b\u3089\u7d4c\u904e\u3057\u305f\u79d2\u6570\u3092\u8868\u3059\u5358\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u578b\uff08Single\uff09\u306e\u5024\u3002<\/li>\n<\/ul>\n<br \/><br \/>\n<p class=\"caution4\"><strong>Timer \u95a2\u6570<\/strong>\u306f\u3001\u51e6\u7406\u4e2d\u306b\u5348\u524d\uff10\u6642\u3092\u8d85\u3048\u305f\u5834\u5408\u3001\u5024\u3092\u300c\uff11\u65e5\u306e\u7dcf\u79d2\u6570\u3092\u53cd\u8ee2\u3057\u305f\u5024\uff08-86,400 \u79d2\uff09\u300d\u306b\u30ea\u30bb\u30c3\u30c8\u3057\u3001\u305d\u3053\u304b\u3089\u7d4c\u904e\u79d2\u6570\u3092\u52a0\u7b97\u3057\u3066\u3044\u304d\u307e\u3059\u3002\u3055\u3089\u306b\uff11\u65e5\u304c\u7d4c\u904e\u3057\u7fcc\u65e5\u306e\u5348\u524d\uff10\u6642\u306b\u306a\u308b\u3068\u300c 0 \u79d2\u300d\u3068\u306a\u308b\u306e\u3067\u3001<strong>\u65e5\u4ed8\u3092\u307e\u305f\u3050\u5834\u5408\u306f\u6ce8\u610f<\/strong>\u304c\u5fc5\u8981\u3067\u3059\u3002<br \/>\n\u3010\u5bfe\u5fdc\u7b56\u3011<br \/>\n\uff11\uff0e\u7d4c\u904e\u6642\u9593\u306e\u5dee\u5206\u306e\u5024\u306e\u7d76\u5bfe\u5024\u3092 <strong>Abs \u95a2\u6570<\/strong>\u7b49\u3067\u7b97\u51fa\u3057\u3066\u3001\u305d\u306e\u5024\u3067\u7d4c\u904e\u79d2\u6570\u3092\u5224\u5b9a\u3059\u308b\u3002<br \/>\n  \uff12\uff0e\u300c<a href=\"#vba_sample_02\">\u3010\u53c2\u8003\u3011\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9\uff12<\/a>\u300d\u306e\u3088\u3046\u306b\u3001Timar \u95a2\u6570\u3092\u4f7f\u7528\u3057\u306a\u3044\u3002<\/p>\n<\/div>\n<br \/>\n<h2>Timer \u95a2\u6570\u306e\u4f7f\u7528\u4f8b<\/h2>\n<div class=\"m30-l\">\n<h3 id=\"vba_sample\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"Timer \u95a2\u6570\u306e\u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_Timer()\r\n\r\n    Dim StartTime\r\n    Dim EndTime\r\n\r\n    StartTime = Timer\r\n    EndTime = 20\r\n    \r\n    With Sheets(\"Sheet1\")\r\n        \r\n        .Cells(1, 1).Value = \"\"\r\n    \r\n        Do Until .Cells(1, 1).Value = 20\r\n            .Cells(1, 1).Value = Int(Timer - StartTime)\r\n            DoEvents\r\n        Loop\r\n    \r\n    End With\r\n\r\nEnd Sub\r\n\u3000\r\n<\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c<\/h3>\n<p><a href=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/timer01a.jpg?ssl=1\" rel=\"lightbox[1450]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/timer01a.jpg?resize=327%2C223&#038;ssl=1\" alt=\"Timer \u95a2\u6570 \u4f7f\u7528\u4f8b\" width=\"327\" height=\"223\" class=\"alignnone size-full wp-image-1455\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<br \/>\n<p class=\"caution4\"><strong>DoEvents \u95a2\u6570<\/strong>\u306b\u3064\u3044\u3066<br \/>\n\u4e0a\u8a18\u30de\u30af\u30ed\u5185\u306b\u306f <strong>DoEvents<\/strong> \u3068\u3044\u3046\u306e\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3053\u306e\u300cDoEvents\u95a2\u6570\u300d\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u4e00\u6642\u7684\u306b\u3001\u4ed6\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b Windows \u306b\u5236\u5fa1\u3092\u79fb\u3059\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3064\u307e\u308a\u3001\u30de\u30af\u30ed\u3092\u5b9f\u884c\u5f8c\u3001VBE \u753b\u9762\u304b\u3089\u30de\u30af\u30ed\u3092\u505c\u6b62\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<br \/><\/div>\n<br \/>\n<h2 id=\"vba_sample_02\">\u3010\u53c2\u8003\u3011\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9\uff12<\/h2>\n<br \/>\n<div class=\"m30-l\">\n<pre class=\"lang:vb mark:0 decode:true \" title=\"Timer \u95a2\u6570\u3092\u4f7f\u7528\u3057\u306a\u3044\u4f8b\" data-url=\"http:\/\/example.co.jp\">\r\n\u3000\r\nSub Sample_Test()\r\n\r\n    Dim StartTime\r\n    Dim EndTime\r\n    \r\n    StartTime = Now\r\n    EndTime = 20\r\n    \r\n    Cells(1, 1).Value = \"\"\r\n    \r\n    Do Until Cells(1, 1).Value = EndTime\r\n    \r\n        Cells(1, 1).Value = Int(DateDiff(\"s\", StartTime, Now))\r\n        DoEvents\r\n    \r\n    Loop\r\n\r\nEnd Sub\r\n\u3000\r\n<\/pre>\n<\/div>\n<br \/>\n","protected":false},"excerpt":{"rendered":"<p>Timer \u95a2\u6570\u306e\u4f7f\u3044\u65b9 \u3010\u66f8\u5f0f\u3011 result = Timer () \u3010\u623b\u308a\u5024 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":1455,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":"\u65e5\u4ed8\u6642\u523b\uff1a\u7d4c\u904e\u6642\u9593\u3092\u53d6\u5f97\uff08 Timer \u95a2\u6570 \uff09"},"categories":[37],"tags":[145,63,38],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/timer01a.jpg?fit=327%2C223&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/s4Ye9i-timer","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/1450"}],"collection":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/comments?post=1450"}],"version-history":[{"count":15,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/1450\/revisions"}],"predecessor-version":[{"id":1466,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/1450\/revisions\/1466"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/1455"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=1450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=1450"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=1450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}