{"id":1249,"date":"2015-04-10T12:58:37","date_gmt":"2015-04-10T03:58:37","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=1249"},"modified":"2016-02-18T21:48:58","modified_gmt":"2016-02-18T12:48:58","slug":"round","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/round\/","title":{"rendered":"\u56db\u6368\u4e94\u5165\u30fb\u5207\u308a\u4e0a\u3052\u30fb\u5207\u308a\u6368\u3066\u30fb\u4e38\u3081\uff08Round \u95a2\u6570 \u4ed6\uff09"},"content":{"rendered":"<h2>Round \u95a2\u6570\uff08\u4e38\u3081\uff09\u306e\u4f7f\u3044\u65b9<\/h2>\n<div class=\"m30-l\">\n<br \/><\/p>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p><em>value<\/em> = <strong>Round<\/strong> ( <em>expression<\/em> [, <em>decimal_places<\/em> ] )<\/p>\n<\/div>\n<br \/>\n<h3>\u3010\u5f15\u6570\u30fb\u623b\u308a\u5024\u3011<\/h3>\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>expression&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u4e38\u3081\u3092\u884c\u3046\u6570\u5024\u30fb\u6570\u5f0f\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002Null \u5024\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u5834\u5408\u306f\u3001Null \u5024\u3092\u8fd4\u3057\u307e\u3059\u3002<\/li>\n<li>decimal_places&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u4e38\u3081\u3092\u884c\u3046\u5c0f\u6570\u70b9\u4ee5\u4e0b\u306e\u6841\u6570\u3092\u8868\u3059\u6570\u5024\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u300c0\u300d\u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u3001<strong>Round \u95a2\u6570<\/strong> \u306f\u3001\u6574\u6570\u5024\u3092\u8fd4\u3057\u307e\u3059\uff08\u7701\u7565\u53ef \u21d2 \u898f\u5b9a\u5024\u306f\u300c0\u300d\uff09\u3002<\/li>\n<li>value&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;<em>decimal_places<\/em> \u3067\u6307\u5b9a\u3055\u308c\u305f\u5c0f\u6570\u70b9\u4f4d\u7f6e\u3067\u4e38\u3081\u305f\u6570\u5024<\/li>\n<\/ul>\n<br \/>\n<p class=\"caution4\"><strong>VBA \u306e Round \u95a2\u6570<\/strong>\u306f\u3001<span class=\"red\"><strong>\u4e38\u3081\uff08\u9280\u884c\u578b\uff09<\/strong><\/span> \u3067\u3059\u3002<\/p>\n<p class=\"caution4\"><strong>Excel \u306e Round \u95a2\u6570<\/strong>\u306f\u3001<span class=\"red\"><strong>\u56db\u6368\u4e94\u5165<\/strong><\/span>\u3067\u3059\u3002<\/p>\n<h3 id=\"vba_sample\">\u9280\u884c\u578b\u4e38\u3081\u3068\u56db\u6368\u4e94\u5165\u306e\u9055\u3044<\/h3>\n<p>\u300c\u6700\u8fd1\u63a5\u5076\u6570\u3078\u306e\u4e38\u3081\u300d\u300c\u5076\u6570\u4e38\u3081\u300d\u300c\u6700\u8fd1\u63a5\u4e38\u3081\u300d\u3068\u3082\u547c\u3070\u308c\u307e\u3059\u3002<br \/>\n<span class=\"red\"><strong>\u9280\u884c\u578b\u4e38\u3081<\/strong><\/span>\u306f\u3001\u7aef\u6570\u304c 0.5 \u3088\u308a\u5c0f\u3055\u3044\u3068\u304d\u306f\u5207\u308a\u6368\u3066\u3001\u7aef\u6570\u304c 0.5 \u3088\u308a\u5927\u304d\u3044\u3068\u304d\u306f\u5207\u308a\u4e0a\u3052\u3001<span class=\"red\">\u7aef\u6570\u304c\u3061\u3087\u3046\u3069 0.5 \u306e\u5834\u5408\u306f\u3001\u5207\u308a\u6368\u3066\u3068\u5207\u308a\u4e0a\u3052\u306e\u3046\u3061\u7d50\u679c\u304c\u5076\u6570\u3068\u306a\u308b\u65b9\u3078\u4e38\u3081\u307e\u3059<\/span>\u3002<\/p>\n<p><a href=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/round01.jpg?ssl=1\" rel=\"lightbox[1249]\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/round01.jpg?resize=400%2C341&#038;ssl=1\" alt=\"\u56db\u6368\u4e94\u5165\u3068\u9280\u884c\u578b\u4e38\u3081\" width=\"400\" height=\"341\" class=\"alignnone size-medium wp-image-1246\" srcset=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/round01.jpg?resize=400%2C341&amp;ssl=1 400w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/round01.jpg?w=510&amp;ssl=1 510w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n<h2>\u56db\u6368\u4e94\u5165\u30fb\u5207\u308a\u4e0a\u3052\u30fb\u5207\u308a\u6368\u3066<\/h2>\n<div class=\"m30-l\">\n<br \/><\/p>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>\uff1c\u56db\u6368\u4e94\u5165\uff1e<br \/>\n<em>value<\/em> = <strong>Application.WorksheetFunction.Round<\/strong> ( <em>expression<\/em> , <em>decimal_places<\/em> )<\/p>\n<p>\uff1c\u5207\u308a\u4e0a\u3052\uff1e<br \/>\n<em>value<\/em> = <strong>Application.WorksheetFunction.RoundUp<\/strong> ( <em>expression<\/em> , <em>decimal_places<\/em> )<\/p>\n<p>\uff1c\u5207\u308a\u6368\u3066\uff1e<br \/>\n<em>value<\/em> = <strong>Application.WorksheetFunction.RoundDown<\/strong> ( <em>expression<\/em> , <em>decimal_places<\/em> )<\/p>\n<\/div>\n<br \/>\n<h3>\u3010\u5f15\u6570\u30fb\u623b\u308a\u5024\u3011<\/h3>\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>expression&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u300c\u56db\u6368\u4e94\u5165\u30fb\u5207\u308a\u4e0a\u3052\u30fb\u5207\u308a\u6368\u3066\u300d\u3092\u884c\u3046\u6570\u5024\u30fb\u6570\u5f0f\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>decimal_places&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u300c\u56db\u6368\u4e94\u5165\u30fb\u5207\u308a\u4e0a\u3052\u30fb\u5207\u308a\u6368\u3066\u300d\u3092\u884c\u3046\u5c0f\u6570\u70b9\u4ee5\u4e0b\u306e\u6841\u6570\u3092\u8868\u3059\u6570\u5024\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u300c0\u300d\u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u306f\u3001\u6574\u6570\u5024\u3092\u8fd4\u3057\u307e\u3059\uff08\u7701\u7565\u4e0d\u53ef\uff09\u3002<\/li>\n<li>value&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;<em>decimal_places<\/em> \u3067\u6307\u5b9a\u3055\u308c\u305f\u5c0f\u6570\u70b9\u4f4d\u7f6e\u3067\u300c\u56db\u6368\u4e94\u5165\u30fb\u5207\u308a\u4e0a\u3052\u30fb\u5207\u308a\u6368\u3066\u300d\u3057\u305f\u6570\u5024<\/li>\n<\/ul>\n<br \/>\n<p class=\"caution4\">\u4e0a\u8a18\u306e <strong>Round \u95a2\u6570<\/strong>\u3001<strong>RoundUp \u95a2\u6570<\/strong>\u3001<strong>RoundDown \u95a2\u6570<\/strong> \u306f\u3001\u30a8\u30af\u30bb\u30eb\u306e\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570\u3067\u3059\u3002<\/p>\n<p class=\"caution4\">\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570\u306f WorksheetFunction \u30af\u30e9\u30b9\u306e\u30e1\u30f3\u30d0\u3067\u3001VBA\u304b\u3089\u3082\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\uff08 \u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570\u3092\u547c\u3073\u51fa\u3059\u306b\u306f Application \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e WorksheetFunction \u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u4f7f\u7528\u3057\u307e\u3059\uff09\u3002<\/p>\n<\/div>\n<br \/><br \/>\n<h2>\u300c\u4e38\u3081\u3001\u56db\u6368\u4e94\u5165\u30fb\u5207\u308a\u4e0a\u3052\u30fb\u5207\u308a\u6368\u3066\u300d\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=\"Round\u30fbRoundUp\u30fbRoundDown \u306e\u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_Round()\r\n\r\n    \r\n    Debug.Print Round(25.52889, 2)\r\n    \r\n    Debug.Print Round(88.509)\r\n    \r\n    Debug.Print Round(Null)\r\n    \r\n    Debug.Print Round(12.45, 1)\r\n    \r\n    Debug.Print Application.WorksheetFunction.Round(12.45, 1)\r\n    \r\n    Debug.Print Application.WorksheetFunction.RoundUp(129.135, 0)\r\n    \r\n    Debug.Print Application.WorksheetFunction.RoundDown(1.155, 2)\r\n    \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:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/round02.jpg?ssl=1\" rel=\"lightbox[1249]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/round02.jpg?resize=400%2C390&#038;ssl=1\" alt=\"\u56db\u6368\u4e94\u5165\u4ed6\u4f7f\u7528\u4f8b\" width=\"400\" height=\"390\" class=\"alignnone size-medium wp-image-1247\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/round02.jpg?resize=400%2C390&amp;ssl=1 400w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/round02.jpg?w=516&amp;ssl=1 516w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<br \/><\/div>\n<br \/><br \/>\n","protected":false},"excerpt":{"rendered":"<p>Round \u95a2\u6570\uff08\u4e38\u3081\uff09\u306e\u4f7f\u3044\u65b9 \u3010\u66f8\u5f0f\u3011 value = Round ( ex &#8230; <\/p>\n","protected":false},"author":1,"featured_media":1252,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":"\u30d6\u30ed\u30b0\u3092\u66f4\u65b0\u3057\u307e\u3057\u305f\uff01"},"categories":[37],"tags":[89,63,38,90],"jetpack_featured_media_url":"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/round01-400x3411.jpg?fit=400%2C341&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/s4Ye9i-round","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/1249"}],"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=1249"}],"version-history":[{"count":4,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/1249\/revisions"}],"predecessor-version":[{"id":5155,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/1249\/revisions\/5155"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/1252"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=1249"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=1249"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=1249"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}