{"id":3395,"date":"2015-08-29T11:58:24","date_gmt":"2015-08-29T02:58:24","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=3395"},"modified":"2015-08-29T11:58:24","modified_gmt":"2015-08-29T02:58:24","slug":"cellworksheetfunction","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/cellworksheetfunction\/","title":{"rendered":"VBA \u3067\u3001\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570\u3092\u4f7f\u7528\uff08WorksheetFunction \u30d7\u30ed\u30d1\u30c6\u30a3\uff09"},"content":{"rendered":"<h2>VBA \u3067\u3001\u30ef\u30fc\u30af\u30b7\u3068\u95a2\u6570\u3092\u4f7f\u7528<\/h2>\n<div class=\"m30-l\">\n<p>VBA \u304b\u3089\u3001\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570\u3092\u547c\u3073\u51fa\u3059\u5834\u5408\u3001<strong>WorksheetFunction \u30d7\u30ed\u30d1\u30c6\u30a3<\/strong> \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u5f15\u6570\u306b\u3001\u30bb\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u3001<strong>Range \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong> \u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u5168\u3066\u306e\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570\u304c\u4f7f\u3048\u308b\u308f\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>WorksheetFunction<\/strong>.<em>function<\/em><\/p><\/div>\n<br \/>\n<h3>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h3>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5bfe\u8c61\u3068\u306a\u308b <span class=\"red\"><strong>Application \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>function&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570<\/li>\n<\/ul><\/div>\n<\/div>\n<br \/><br \/>\n<h2>\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570 \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=\"\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_WorkSheetFunction()\r\n\r\n    Const SYOHIZEI = 0.08\r\n    Dim i As Integer\r\n    \r\n    For i = 2 To 8\r\n            \r\n        '\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570\u306e Round \u95a2\u6570\u3067\u3001\u5c0f\u6570\u70b9\u4ee5\u4e0b\u3092\u56db\u6368\u4e94\u5165\r\n        Cells(i, 3).Value = _\r\n            Application.WorksheetFunction.Round(Cells(i, 2).Value * SYOHIZEI, 0)\r\n    \r\n        '\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570\u306e Sum \u95a2\u6570\u3067\u5408\u8a08\u3092\u6c42\u3081\u308b\r\n        Cells(i, 4).Value = _\r\n            Application.WorksheetFunction.Sum(Range(Cells(i, 2), Cells(i, 3)))\r\n    \r\n    Next i\r\n\r\n    \r\n    '\u5404\u5217\u306e\u5408\u8a08\u3092 Sum \u95a2\u6570\u3067\u6c42\u3081\u308b\r\n    Range(\"B9\").Value = Application.WorksheetFunction.Sum(Range(\"B1:B8\"))\r\n    Range(\"C9\").Value = Application.WorksheetFunction.Sum(Range(\"C1:C8\"))\r\n    Range(\"D9\").Value = Application.WorksheetFunction.Sum(Range(\"D1:D8\"))\r\n\r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c<\/h3>\n<p>\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9\u5b9f\u884c\u524d<\/p>\n<p><a href=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/worksheetfunction_01.jpg?ssl=1\" rel=\"lightbox[3395]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/worksheetfunction_01.jpg?resize=580%2C365&#038;ssl=1\" alt=\"WorksheetFunction \u30d7\u30ed\u30d1\u30c6\u30a3\u3000\u4f7f\u7528\u4f8b01\" width=\"580\" height=\"365\" class=\"alignnone size-large wp-image-3396\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/worksheetfunction_01.jpg?resize=580%2C365&amp;ssl=1 580w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/worksheetfunction_01.jpg?resize=400%2C252&amp;ssl=1 400w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/worksheetfunction_01.jpg?w=586&amp;ssl=1 586w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>\u5b9f\u884c\u5f8c<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/worksheetfunction_02.jpg?ssl=1\" rel=\"lightbox[3395]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/worksheetfunction_02.jpg?resize=580%2C366&#038;ssl=1\" alt=\"WorksheetFunction \u4f7f\u7528\u4f8b02\" width=\"580\" height=\"366\" class=\"alignnone size-large wp-image-3397\" srcset=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/worksheetfunction_02.jpg?resize=580%2C366&amp;ssl=1 580w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/worksheetfunction_02.jpg?resize=400%2C252&amp;ssl=1 400w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/worksheetfunction_02.jpg?w=587&amp;ssl=1 587w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/>\n","protected":false},"excerpt":{"rendered":"<p>VBA \u3067\u3001\u30ef\u30fc\u30af\u30b7\u3068\u95a2\u6570\u3092\u4f7f\u7528 VBA \u304b\u3089\u3001\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u95a2\u6570\u3092\u547c\u3073\u51fa\u3059\u5834\u5408\u3001 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":3425,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[268],"tags":[301,63,530,38,269],"jetpack_featured_media_url":"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/worksheetfunction_01-580x3651.jpg?fit=580%2C365&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-SL","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/3395"}],"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=3395"}],"version-history":[{"count":3,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/3395\/revisions"}],"predecessor-version":[{"id":3424,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/3395\/revisions\/3424"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/3425"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=3395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=3395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=3395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}