{"id":855,"date":"2015-03-17T15:28:54","date_gmt":"2015-03-17T06:28:54","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=855"},"modified":"2015-06-16T09:00:30","modified_gmt":"2015-06-16T00:00:30","slug":"vba_inputbox","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/vba_inputbox\/","title":{"rendered":"\u30a4\u30f3\u30d7\u30c3\u30c8\u30dc\u30c3\u30af\u30b9\u3092\u8868\u793a\u3059\u308b\uff08InputBox\u95a2\u6570\u30fbInputBox\u30e1\u30bd\u30c3\u30c9\uff09"},"content":{"rendered":"<h2>\u300cInputBox\u95a2\u6570\u300d\u3068\u300cInputBox\u30e1\u30bd\u30c3\u30c9\u300d\u306e\u9055\u3044<\/h2>\n<div class=\"m30-l\">\n<p><span class=\"red\"><strong>\u300cInputBox\u30e1\u30bd\u30c3\u30c9\u300d<\/strong><\/span>\u306e\u5834\u5408\u306f\u3001<span class=\"box-red\">\u8fd4\u3059\u30c7\u30fc\u30bf\u578b\u3092\u5f15\u6570\u3067\u6307\u5b9a<\/span>\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u306b\u30bb\u30eb\u7bc4\u56f2\u3092\u9078\u629e\u3055\u305b\u308b\u5834\u5408\uff08\u30c7\u30fc\u30bf\u578b\u3092Range\u578b\u306b\u6307\u5b9a\uff09\u306f\u3001InputBox\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001<strong>[\u30ad\u30e3\u30f3\u30bb\u30eb] \u30dc\u30bf\u30f3\u3084 [\u00d7] \u30dc\u30bf\u30f3\u3092\u62bc\u3057\u305f\u5834\u5408<\/strong>\u3001<span class=\"blue\"><strong>\u300cInputBox\u95a2\u6570\u300d<\/strong><\/span>\u306e\u5834\u5408\u306f<span class=\"box-aqua\">\u300c\u7a7a\u6587\u5b57\uff08&#8221;&#8221;\uff09\u300d<\/span>\u3092<span class=\"red\"><strong>\u300cInputBox\u30e1\u30bd\u30c3\u30c9\u300d<\/strong><\/span>\u306e\u5834\u5408\u306f<span class=\"box-red\">\u300cFalse\u300d<\/span>\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<\/div>\n<br \/>\n<h2>InputBox\u95a2\u6570<\/h2>\n<br \/><br \/>\n<div class=\"m30-l\">\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><br \/>\n<em>result<\/em> = <strong>InputBox<\/strong> ( <em>Prompt<\/em> [ <em>Title, Default, Xpos, Ypos, HelpFile, Context<\/em> ] )\n<\/div>\n<h3>\u3010\u5f15\u6570\u3011<\/h3>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>Prompt&nbsp;\u30fb\u30fb\u30fb&nbsp;\u8868\u793a\u3059\u308b\u6587\u5b57\u5217<\/li>\n<li>Title&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;\u30c0\u30a4\u30a2\u30ed\u30b0\u30dc\u30c3\u30af\u30b9\u306e\u30bf\u30a4\u30c8\u30eb\u30d0\u30fc\u306b\u8868\u793a\u3059\u308b\u6587\u5b57\u5217\uff08\u7701\u7565\u53ef\uff09<\/li>\n<li>Default&nbsp;\u30fb\u30fb\u30fb&nbsp;\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u8868\u793a\u3059\u308b\u6587\u5b57\u5217\uff08\u7701\u7565\u53ef\uff09<\/li>\n<li>Xpos&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;\u5de6\u7aef\u4f4d\u7f6e\uff08\u5358\u4f4d\u306fTwip\uff09\uff08\u7701\u7565\u53ef\uff09<\/li>\n<li>Ypos&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;\u4e0a\u7aef\u4f4d\u7f6e\uff08\u5358\u4f4d\u306fTwip\uff09\uff08\u7701\u7565\u53ef\uff09<\/li>\n<li>HelpFile&nbsp;\u30fb\u30fb\u30fb&nbsp;\u30d8\u30eb\u30d7\u30d5\u30a1\u30a4\u30eb\u306e\u30d5\u30a1\u30a4\u30eb\u540d\uff08\u7701\u7565\u53ef\uff09<\/li>\n<li>Context&nbsp;\u30fb\u30fb\u30fb&nbsp;\u30d8\u30eb\u30d7\u30c8\u30d4\u30c3\u30af\u306b\u6307\u5b9a\u3057\u305f\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u756a\u53f7\uff08\u7701\u7565\u53ef\uff09<\/li>\n<\/ul>\n<\/div>\n<h3>\u3010\u623b\u5024\u3011<\/h3>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>result&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;\u30e6\u30fc\u30b6\u30fc\u304c\u5165\u529b\u3057\u305f\u5024\uff08\u6587\u5b57\u5217\u578b\uff1aString\uff09<\/ul>\n<\/div>\n<br \/><br \/>\n<p class=\"caution3\">\u5f15\u6570 Title \u3092\u7701\u7565\u3059\u308b\u3068\u3001\u300cMicrosoft Excel\u300d\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p class=\"caution3\">\u5f15\u6570 Helpfile \u306b\u3001\u4f7f\u7528\u3059\u308b\u30d8\u30eb\u30d7\u30d5\u30a1\u30a4\u30eb\u306e\u540d\u524d\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067 [F1] \u30ad\u30fc\u3092\u62bc\u3057\u3066\u30d8\u30eb\u30d7\u3092\u53c2\u7167\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u306e\u3068\u304d \u5f15\u6570 Context \u3082\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p class=\"caution3\">[\u30ad\u30e3\u30f3\u30bb\u30eb\u30dc\u30bf\u30f3] \u3084\u53f3\u4e0a\u306e [\u00d7] \u30dc\u30bf\u30f3\u3092\u62bc\u3057\u305f\u5834\u5408\u306e\u623b\u308a\u5024\u306f\u3001\u7a7a\u6587\u5b57\uff08&#8221;&#8221;\uff09\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p class=\"caution3\">Twip \u306f\u3001\u9577\u3055\u3092\u8868\u3059\u5358\u4f4d\u3067\u30011\/20\u30dd\u30a4\u30f3\u30c8\u3067\u3059\u3002<\/p>\n<\/div>\n<br \/>\n<h2>InputBox\u30e1\u30bd\u30c3\u30c9<\/h2>\n<br \/><br \/>\n<div class=\"m30-l\">\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><br \/>\n<em>result<\/em> = <strong>Object.InputBox<\/strong> ( <em>Prompt<\/em> [ <em>Title, Default, Left, Top, HelpFile, Context, Type<\/em> ] )\n<\/div>\n<h3>\u3010\u5f15\u6570\u3011<\/h3>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>Prompt&nbsp;\u30fb\u30fb\u30fb&nbsp;\u8868\u793a\u3059\u308b\u6587\u5b57\u5217<\/li>\n<li>Title&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;\u30c0\u30a4\u30a2\u30ed\u30b0\u30dc\u30c3\u30af\u30b9\u306e\u30bf\u30a4\u30c8\u30eb\u30d0\u30fc\u306b\u8868\u793a\u3059\u308b\u6587\u5b57\u5217\uff08\u7701\u7565\u53ef\uff09<\/li>\n<li>Default&nbsp;\u30fb\u30fb\u30fb&nbsp;\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u8868\u793a\u3059\u308b\u6587\u5b57\u5217\uff08\u7701\u7565\u53ef\uff09<\/li>\n<li>Left&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;\u5de6\u7aef\u4f4d\u7f6e\uff08\u5358\u4f4d\u306f\u30dd\u30a4\u30f3\u30c8\uff09\uff08\u7701\u7565\u53ef\uff09<\/li>\n<li>Top&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;\u4e0a\u7aef\u4f4d\u7f6e\uff08\u5358\u4f4d\u306f\u30dd\u30a4\u30f3\u30c8\uff09\uff08\u7701\u7565\u53ef\uff09<\/li>\n<li>HelpFile&nbsp;\u30fb\u30fb\u30fb&nbsp;\u30d8\u30eb\u30d7\u30d5\u30a1\u30a4\u30eb\u306e\u30d5\u30a1\u30a4\u30eb\u540d\uff08\u7701\u7565\u53ef\uff09<\/li>\n<li>Context&nbsp;\u30fb\u30fb\u30fb&nbsp;\u30d8\u30eb\u30d7\u30c8\u30d4\u30c3\u30af\u306b\u6307\u5b9a\u3057\u305f\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u756a\u53f7\uff08\u7701\u7565\u53ef\uff09<\/li>\n<li>Type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;\u5b9a\u6570\uff1a\u8fd4\u3059\u30c7\u30fc\u30bf\u578b\uff08\u7701\u7565\u53ef\uff09<a href=\"#\u623b\u5024\u5b9a\u6570\u4e00\u89a7\">\u21d2 \u623b\u5024\u30c7\u30fc\u30bf\u578b\u4e00\u89a7\u8868<\/a><\/li>\n<\/ul>\n<\/div>\n<h3>\u3010\u623b\u5024\u3011<\/h3>\n<div class=\"m30-l\">\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>result&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;\u30e6\u30fc\u30b6\u30fc\u304c\u5165\u529b\u3057\u305f\u5024\uff08Variant\u578b\uff1a\u5f15\u6570 Type \u3067\u6307\u5b9a\u3057\u305f\u578b\uff09<\/ul>\n<\/div>\n<br \/><br \/>\n<p class=\"caution3\">\u5f15\u6570 Title \u3092\u7701\u7565\u3059\u308b\u3068\u3001\u300cMicrosoft Excel\u300d\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p class=\"caution3\">\u5f15\u6570 Helpfile \u306b\u3001\u4f7f\u7528\u3059\u308b\u30d8\u30eb\u30d7\u30d5\u30a1\u30a4\u30eb\u306e\u540d\u524d\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067 [F1] \u30ad\u30fc\u3092\u62bc\u3057\u3066\u30d8\u30eb\u30d7\u3092\u53c2\u7167\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u306e\u3068\u304d \u5f15\u6570 Context \u3082\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p class=\"caution3\">[\u30ad\u30e3\u30f3\u30bb\u30eb\u30dc\u30bf\u30f3] \u3084\u53f3\u4e0a\u306e [\u00d7] \u30dc\u30bf\u30f3\u3092\u62bc\u3057\u305f\u5834\u5408\u306e\u623b\u308a\u5024\u306f\u3001\u300cFalse\u300d\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p class=\"caution3\"> Left, Top \u306f\u3001Excel2007 \u4ee5\u964d\u3067\u306f\u3069\u3093\u306a\u5024\u3092\u5165\u308c\u3066\u3082\u524d\u56de\u306e\u8868\u793a\u4f4d\u7f6e\u3068\u540c\u3058\u4f4d\u7f6e\u306b\u8868\u793a\u3055\u308c\u308b\u307e\u3059\u3002<\/p>\n<h3 id=\"\u623b\u5024\u5b9a\u6570\u4e00\u89a7\">\u3010\u623b\u5024\u306e\u30c7\u30fc\u30bf\u578b\u3092\u793a\u3059\u5b9a\u6570\u306e\u4e00\u89a7\uff08Type\uff09\u3011<\/h3>\n<table>\n<tr>\n<td align=\"center\" width=\"70\"><strong>\u5024<\/strong><\/td>\n<td align=\"center\" width=\"300\"><strong>\u5185\u5bb9\uff08\u623b\u5024\u306e\u30c7\u30fc\u30bf\u578b\uff09<\/strong><\/td>\n<td align=\"center\" width=\"220\"><strong>\u5165\u529b\u4f8b<\/strong><\/td>\n<\/tr>\n<tr>\n<td align=\"center\">0<\/td>\n<td>\u6570\u5f0f\uff08String\uff09<\/td>\n<td>=A1+A2<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">1<\/td>\n<td>\u6570\u5024\uff08Double\uff09<\/td>\n<td>55<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">2<\/td>\n<td>\u6587\u5b57\u5217\uff08String\uff09<\/td>\n<td>\u3042\u3044\u3046\u3048\u304a<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">4<\/td>\n<td>\u8ad6\u7406\u578b\uff1aTrue\uff0fFalse\uff08Boolean\uff09<\/td>\n<td>True<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">8<\/td>\n<td>\u30bb\u30eb\u53c2\u7167\uff08Range\uff09<\/td>\n<td>A1:A5<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">16<\/td>\n<td>\u30a8\u30e9\u30fc\u5024\uff08Error\uff09<\/td>\n<td>#N\/A<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">64<\/td>\n<td>\u6570\u5024\u914d\u5217\uff08Variant()\uff09<\/td>\n<td>{1,2,3,4,5}<\/td>\n<\/tr>\n<tr>\n<td align=\"center\">\u7701\u7565\u6642<\/td>\n<td>\u6587\u5b57\u5217\uff08String\uff09<\/td>\n<td>\u3042\u3044\u3046\u3048\u304a<\/td>\n<\/tr>\n<\/table>\n<br \/><br \/><\/div>\n<h2>InputBox\u95a2\u6570\/InputBox\u30e1\u30bd\u30c3\u30c9\u306e\u4f7f\u7528\u4f8b<\/h2>\n<div class=\"m30-l\">\n<h3>VBA\u30bd\u30fc\u30b9<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"Input\u95a2\u6570\/Input\u30e1\u30bd\u30c3\u30c9\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_InputBox()\r\n\r\n    Dim FStr As String\r\n    Dim MStr As Variant\r\n    \r\n    '\u30a4\u30f3\u30d7\u30c3\u30c8\u30dc\u30c3\u30af\u30b9\u95a2\u6570\r\n    FStr = InputBox( _\r\n        Prompt:=\"\u5024\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\uff01\uff01\", _\r\n        Title:=\"\u30a4\u30f3\u30d7\u30c3\u30c8\u95a2\u6570\u4f8b\", _\r\n        Default:=\"\u3053\u3053\u306b\u5165\u529b\" _\r\n    )\r\n\r\n    '\u30a4\u30f3\u30d7\u30c3\u30c8\u30dc\u30c3\u30af\u30b9\u30e1\u30bd\u30c3\u30c9       \r\n    Set MStr = Application.InputBox( _\r\n        Prompt:=\"\u30bb\u30eb\u7bc4\u56f2\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\", _\r\n        Title:=\"\u30a4\u30f3\u30d7\u30c3\u30c8\u30e1\u30bd\u30c3\u30c9\u4f8b\", _\r\n        Type:=8 _\r\n    )\r\n\r\nEnd Sub    \r\n\u3000\r\n<\/pre>\n<h3>InputBox\u30de\u30af\u30ed\u5b9f\u884c\u4f8b<\/h3>\n<p><a href=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/03\/inputbox_f01.jpg?ssl=1\" rel=\"lightbox[855]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/03\/inputbox_f01.jpg?resize=400%2C214&#038;ssl=1\" alt=\"\u30a4\u30f3\u30d7\u30c3\u30c8\u30dc\u30c3\u30af\u30b9\u95a2\u6570\uff08\u4f8b\uff09\" width=\"400\" height=\"214\" class=\"alignnone size-medium wp-image-885\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/03\/inputbox_f01.jpg?resize=400%2C214&amp;ssl=1 400w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/03\/inputbox_f01.jpg?resize=580%2C310&amp;ssl=1 580w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/03\/inputbox_f01.jpg?w=1129&amp;ssl=1 1129w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p><a href=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/03\/inputbox_m01.jpg?ssl=1\" rel=\"lightbox[855]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/03\/inputbox_m01.jpg?resize=400%2C214&#038;ssl=1\" alt=\"\u30a4\u30f3\u30d7\u30c3\u30c8\u30dc\u30c3\u30af\u30b9\u30e1\u30bd\u30c3\u30c9\uff08\u4f8b\uff09\" width=\"400\" height=\"214\" class=\"alignnone size-medium wp-image-886\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/03\/inputbox_m01.jpg?resize=400%2C214&amp;ssl=1 400w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/03\/inputbox_m01.jpg?resize=580%2C310&amp;ssl=1 580w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/03\/inputbox_m01.jpg?w=1129&amp;ssl=1 1129w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<br \/><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u300cInputBox\u95a2\u6570\u300d\u3068\u300cInputBox\u30e1\u30bd\u30c3\u30c9\u300d\u306e\u9055\u3044 \u300cInputBox &#8230; <\/p>\n","protected":false},"author":1,"featured_media":889,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[37],"tags":[46,45,47,38],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/03\/inputbox_f01-400x2141.jpg?fit=400%2C214&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-dN","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/855"}],"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=855"}],"version-history":[{"count":34,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/855\/revisions"}],"predecessor-version":[{"id":2293,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/855\/revisions\/2293"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/889"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=855"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=855"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=855"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}