{"id":3480,"date":"2015-09-04T08:46:43","date_gmt":"2015-09-03T23:46:43","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=3480"},"modified":"2015-09-04T08:46:43","modified_gmt":"2015-09-03T23:46:43","slug":"datavalidation04","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/datavalidation04\/","title":{"rendered":"\u5165\u529b\u898f\u5247\uff08\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u8a2d\u5b9a\uff09Validation \u30aa\u30d6\u30b8\u30a7\u30af\u30c8"},"content":{"rendered":"<h2>\u7121\u52b9\u5024\u3092\u5165\u529b\u6642\u306b\u3001\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u8868\u793a<\/h2>\n<div class=\"m30-l\">\n<p><strong>Validation.ShowError \u30d7\u30ed\u30d1\u30c6\u30a3<\/strong> \u3092 <strong>True<\/strong> \u306b\u8a2d\u5b9a\u3059\u308b\u3068\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u7121\u52b9\u306a\u30c7\u30fc\u30bf\u3092\u5165\u529b\u3057\u305f\u6642\u3001\u5165\u529b\u898f\u5247\u3067\u306e\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>ShowError<\/strong> = <em>boolean<\/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>Validation \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>boolean&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d6\u30fc\u30eb\u578b\uff08Boolean\uff09\u306e\u5024\uff08<strong>True<\/strong> \u307e\u305f\u306f\u3001<strong>False<\/strong>\uff09\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<br \/><\/div>\n<\/div>\n<br \/><br \/>\n<h2>\u5165\u529b\u898f\u5247\u3067\u306e\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u7a2e\u985e\u3092\u53d6\u5f97<\/h2>\n<div class=\"m30-l\">\n<p><strong>Validation.AlertStyle \u30d7\u30ed\u30d1\u30c6\u30a3<\/strong> \u306f\u3001\u5165\u529b\u898f\u5247\u3067\u306e\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u7a2e\u985e\u3092\u9577\u6574\u6570\u578b\uff08Long\uff09\u306e\u5024\uff08<strong>XlDVAlertStyle \u5217\u6319\u578b<\/strong> \u3092\u4f7f\u7528\uff09\u3092\u8fd4\u3057\u307e\u3059\u3002\u53d6\u5f97\u306e\u307f\u53ef\u80fd\u3067\u3059\u3002\u8a2d\u5b9a\u306f\u3001<strong>Validation.Add \u30e1\u30bd\u30c3\u30c9<\/strong> \u3067\u884c\u3044\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>AlertStyle<\/strong><\/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>Validation \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<br \/><\/div>\n<\/div>\n<br \/><br \/>\n<h2>\u5165\u529b\u898f\u5247\u306e\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u8a2d\u5b9a<\/h2>\n<div class=\"m30-l\">\n<p><strong>Validation.ErrorTitle \u30d7\u30ed\u30d1\u30c6\u30a3<\/strong> \u3067\u3001\u30a8\u30e9\u30fc\u767a\u751f\u6642\u306b\u8868\u793a\u3055\u308c\u308b\u30c0\u30a4\u30a2\u30ed\u30b0\u30dc\u30c3\u30af\u30b9\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>ErrorTitle<\/strong> = <em>string<\/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>Validation \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>string&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30a8\u30e9\u30fc\u30c0\u30a4\u30a2\u30ed\u30b0\u30dc\u30c3\u30af\u30b9\u306b\u8868\u793a\u3055\u308c\u308b\u30bf\u30a4\u30c8\u30eb\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u6587\u5b57\u5217\u578b\uff08String\uff09\u306e\u5024\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\uff08\u203b \u5024\u306e\u53d6\u5f97\u304a\u3088\u3073\u8a2d\u5b9a\u304c\u53ef\u80fd\u3067\u3059\u3002\uff09<\/li>\n<\/ul>\n<br \/><\/div>\n<\/div>\n<br \/><br \/>\n<h2>\u5165\u529b\u898f\u5247\u306e\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8a2d\u5b9a<\/h2>\n<div class=\"m30-l\">\n<p><strong>Validation.ErrorMessage \u30d7\u30ed\u30d1\u30c6\u30a3<\/strong> \u3067\u3001\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>ErrorMessage<\/strong> = <em>string<\/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>Validation \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>string&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002\u6587\u5b57\u5217\u578b\uff08String\uff09\u306e\u5024\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\uff08\u203b \u5024\u306e\u53d6\u5f97\u304a\u3088\u3073\u8a2d\u5b9a\u304c\u53ef\u80fd\u3067\u3059\u3002\uff09<\/li>\n<\/ul>\n<br \/><\/div>\n<\/div>\n<br \/><br \/>\n<h2>\u5165\u529b\u898f\u5247\uff08\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\uff09\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=\"\u5165\u529b\u898f\u5247\uff08\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\uff09\u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample04_Validation()\r\n\r\n    With Range(\"B2\").Validation\r\n            \r\n        '\u5165\u529b\u898f\u5247\u3092\u524a\u9664\r\n        .Delete\r\n        \r\n        '\u5165\u529b\u898f\u5247\u306e\u8a2d\u5b9a\r\n        '\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u30b9\u30bf\u30a4\u30eb\u306f\u300c\u505c\u6b62\u300d\r\n        '\u5165\u529b\u5024\uff1a0\u4ee5\u4e0a\u30011000\u4ee5\u4e0b\u306e\u6570\u5024\r\n        .Add Type:=xlValidateWholeNumber, _\r\n             AlertStyle:=xlValidAlertStop, _\r\n             Operator:=xlBetween, _\r\n             Formula1:=0, _\r\n             Formula2:=1000\r\n                   \r\n        '\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u8a2d\u5b9a\r\n        .ErrorTitle = \"\u30a8\u30e9\u30fc\u767a\u751f\"\r\n        .ErrorMessage = \"0 \u304b\u3089 1000 \u307e\u3067\u306e\u6570\u5024\u4ee5\u5916\u306f\u5165\u529b\u3067\u304d\u307e\u305b\u3093\uff01\"\r\n        .ShowError = True\r\n        \r\n        '\u5165\u529b\u6642\u30e1\u30c3\u30bb\u30fc\u30b8\uff08\u8868\u793a\u3057\u306a\u3044\uff09\r\n        .InputTitle = \"\"\r\n        .InputMessage = \"\"\r\n        .ShowInput = False\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>\u7bc4\u56f2\u5916\u306e\u5024\u3092\u5165\u529b<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/validation_004_01.jpg?ssl=1\" rel=\"lightbox[3480]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/validation_004_01.jpg?resize=580%2C349&#038;ssl=1\" alt=\"Validation \u30d7\u30ed\u30d1\u30c6\u30a3 \u4f7f\u7528\u4f8b4\" width=\"580\" height=\"349\" class=\"alignnone size-large wp-image-3481\" srcset=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/validation_004_01.jpg?resize=580%2C349&amp;ssl=1 580w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/validation_004_01.jpg?resize=400%2C241&amp;ssl=1 400w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/validation_004_01.jpg?w=616&amp;ssl=1 616w\" sizes=\"(max-width: 580px) 100vw, 580px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/>\n","protected":false},"excerpt":{"rendered":"<p>\u7121\u52b9\u5024\u3092\u5165\u529b\u6642\u306b\u3001\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u8868\u793a Validation.ShowErro &#8230; <\/p>\n","protected":false},"author":1,"featured_media":3546,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[268],"tags":[270,538,63,38,269],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/09\/validation_004_01-580x3491.jpg?fit=580%2C349&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-U8","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/3480"}],"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=3480"}],"version-history":[{"count":3,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/3480\/revisions"}],"predecessor-version":[{"id":3545,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/3480\/revisions\/3545"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/3546"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=3480"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=3480"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=3480"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}