{"id":3184,"date":"2015-08-24T11:09:44","date_gmt":"2015-08-24T02:09:44","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=3184"},"modified":"2015-08-24T11:09:44","modified_gmt":"2015-08-24T02:09:44","slug":"findnextfindprevious","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/findnextfindprevious\/","title":{"rendered":"\u6b21\u306e\u691c\u7d22\uff08FindNext \u30e1\u30bd\u30c3\u30c9,FindPrevious \u30e1\u30bd\u30c3\u30c9\uff09"},"content":{"rendered":"<h2>FindNext \u30e1\u30bd\u30c3\u30c9<\/h2>\n<div class=\"m30-l\">\n<p>Find \u30e1\u30bd\u30c3\u30c9\u3067\u958b\u59cb\u3055\u308c\u305f\u691c\u7d22\u3092\u7d99\u7d9a\u3057\u307e\u3059\u3002\u5f15\u6570\u3067\u6307\u5b9a\u3057\u305f\u30bb\u30eb\u306e\u76f4\u5f8c\u306e\u30bb\u30eb\u304b\u3089\u3001\u540c\u3058\u691c\u7d22\u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b\u30bb\u30eb\u3092\u691c\u7d22\u3057\u3001\u898b\u3064\u304b\u3063\u305f\u30bb\u30eb\u3092\u8868\u3059 <strong>Range \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong>\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>FindNext<\/strong> ( [ <em>after<\/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>Range \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>after&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;<em>object<\/em> \u3067\u6307\u5b9a\u3057\u305f\u30bb\u30eb\u7bc4\u56f2\u5185\u306e\u30bb\u30eb\u306e\uff11\u3064\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<span class=\"red\">\u3053\u306e\u30bb\u30eb\u306e\u6b21\u306e\u30bb\u30eb\u304b\u3089\u691c\u7d22\u304c\u958b\u59cb\u3055\u308c\u307e\u3059\u3002<\/span>\u3053\u306e\u30bb\u30eb\u81ea\u4f53\u306f\u3001\u6307\u5b9a\u7bc4\u56f2\u5168\u4f53\u3092\u691c\u7d22\u3057\u623b\u3063\u3066\u304f\u308b\u307e\u3067\u306f\u691c\u7d22\u3055\u308c\u307e\u305b\u3093\u3002\u7701\u7565\u3059\u308b\u3068\u3001\u5bfe\u8c61\u306e\u30bb\u30eb\u7bc4\u56f2\u5de6\u4e0a\u7aef\u30bb\u30eb\u304c\u691c\u7d22\u958b\u59cb\u70b9\u3068\u306a\u308a\u307e\u3059\u3002<\/li>\n<li>\u623b\u308a\u5024&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u691c\u7d22\u306e\u7d50\u679c\u3001\u6761\u4ef6\u3092\u6e80\u305f\u3059\u30bb\u30eb\u304c\u898b\u3064\u304b\u3063\u305f\u3089\u305d\u306e\u5148\u982d\u306e\u30bb\u30eb\u3092\u8868\u3059 <strong>Range \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong>\u3092\u8fd4\u3057\u307e\u3059\u3002\u898b\u3064\u304b\u3089\u306a\u304b\u3063\u305f\u5834\u5408\u306f\u3001<strong>Nothing<\/strong> \u3092\u8fd4\u3057\u307e\u3059\u3002<\/li>\n<\/ul><\/div>\n<\/div>\n<br \/>\n<h2>FindPrevious \u30e1\u30bd\u30c3\u30c9<\/h2>\n<div class=\"m30-l\">\n<p>Find \u30e1\u30bd\u30c3\u30c9\u3067\u958b\u59cb\u3055\u308c\u305f\u691c\u7d22\u3092\u7d99\u7d9a\u3057\u307e\u3059\u3002\u5f15\u6570\u3067\u6307\u5b9a\u3057\u305f\u30bb\u30eb\u306e\u76f4\u524d\u306e\u30bb\u30eb\u304b\u3089\u3001\u540c\u3058\u691c\u7d22\u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b\u30bb\u30eb\u3092\u9006\u65b9\u5411\u306b\u691c\u7d22\u3057\u3001\u898b\u3064\u304b\u3063\u305f\u30bb\u30eb\u3092\u8868\u3059 <strong>Range \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong>\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>FindPrevious<\/strong> ( [ <em>after<\/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>Range \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>after&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;<em>object<\/em> \u3067\u6307\u5b9a\u3057\u305f\u30bb\u30eb\u7bc4\u56f2\u5185\u306e\u30bb\u30eb\u306e\uff11\u3064\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<span class=\"red\">\u3053\u306e\u30bb\u30eb\u306e\u76f4\u524d\u306e\u30bb\u30eb\u304b\u3089\u9006\u65b9\u5411\u306b\u691c\u7d22\u304c\u958b\u59cb\u3055\u308c\u307e\u3059\u3002<\/span>\u3053\u306e\u30bb\u30eb\u81ea\u4f53\u306f\u3001\u6307\u5b9a\u7bc4\u56f2\u5168\u4f53\u3092\u691c\u7d22\u3057\u623b\u3063\u3066\u304f\u308b\u307e\u3067\u306f\u691c\u7d22\u3055\u308c\u307e\u305b\u3093\u3002\u7701\u7565\u3059\u308b\u3068\u3001\u5bfe\u8c61\u306e\u30bb\u30eb\u7bc4\u56f2\u5de6\u4e0a\u7aef\u30bb\u30eb\u304c\u691c\u7d22\u958b\u59cb\u70b9\u3068\u306a\u308a\u307e\u3059\u3002<\/li>\n<li>\u623b\u308a\u5024&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u691c\u7d22\u306e\u7d50\u679c\u3001\u6761\u4ef6\u3092\u6e80\u305f\u3059\u30bb\u30eb\u304c\u898b\u3064\u304b\u3063\u305f\u3089\u305d\u306e\u5148\u982d\u306e\u30bb\u30eb\u3092\u8868\u3059 <strong>Range \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong>\u3092\u8fd4\u3057\u307e\u3059\u3002\u898b\u3064\u304b\u3089\u306a\u304b\u3063\u305f\u5834\u5408\u306f\u3001<strong>Nothing<\/strong> \u3092\u8fd4\u3057\u307e\u3059\u3002<\/li>\n<\/ul><\/div>\n<\/div>\n<br \/><br \/>\n<h2>FindNext \u30e1\u30bd\u30c3\u30c9 \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=\"FindNext \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_FindNext()\r\n\r\n    Dim myRng As Range\r\n    Dim firstCell As Range\r\n    Dim str As String\r\n\r\n    '\u691c\u7d22\u5024\u300c\u30b9\u30fc\u30d1\u30fc\u300d\u958b\u59cb\u300cA1\u300d\u5bfe\u8c61\u300c\u5024\u300d\u6761\u4ef6\u300c\u5b8c\u5168\u4e00\u81f4\u300d\u7e26\u6a2a\u65b9\u5411\u300c\u884c\u2192\u5217\u300d\r\n    '\u65b9\u5411\u300c\u5f8c\u65b9\u691c\u7d22\u300d\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u300c\u533a\u5225\u3057\u306a\u3044\u300d\u534a\u89d2\u5168\u89d2\u300c\u533a\u5225\u3057\u306a\u3044\u300d\u66f8\u5f0f\u691c\u7d22\u300c\u3057\u306a\u3044\u300d\r\n    Set myRng = Cells.Find(\"\u30b9\u30fc\u30d1\u30fc\", _\r\n                            After:=Range(\"A1\"), _\r\n                            LookIn:=xlValues, _\r\n                            LookAt:=xlWhole, _\r\n                            SearchOrder:=xlByRows, _\r\n                            SearchDirection:=xlNext, _\r\n                            MatchCase:=False, _\r\n                            MatchByte:=False, _\r\n                            searchformat:=False)\r\n    \r\n    '\u898b\u3064\u304b\u3089\u306a\u304b\u3063\u305f\u5834\u5408\u691c\u7d22\u3092\u7d42\u4e86\u3057\u307e\u3059\r\n    If myRng Is Nothing Then\r\n        \r\n        MsgBox \"\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\"\r\n        Exit Sub\r\n    \r\n    End If\r\n    \r\n    Set firstCell = myRng\r\n\r\n    '\u6700\u521d\u306e\u691c\u7d22\u4f4d\u7f6e\u306b\u623b\u308b\u307e\u3067\u691c\u7d22\u3092\u7e70\u308a\u8fd4\u3059\r\n    Do\r\n    \r\n        str = str & myRng.Address & vbLf\r\n        \r\n        '\u6b21\u3092\u691c\u7d22\r\n        Set myRng = Cells.FindNext(myRng)\r\n\r\n    Loop While firstCell.Address <> myRng.Address\r\n    \r\n    \r\n    '\u7d50\u679c\u8868\u793a\r\n    MsgBox str\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\/08\/findnextprevious_01.jpg?ssl=1\" rel=\"lightbox[3184]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/findnextprevious_01.jpg?resize=400%2C316&#038;ssl=1\" alt=\"FindNext \u30e1\u30bd\u30c3\u30c9\u30fbFindPrevious \u30e1\u30bd\u30c3\u30c9 \u4f8b01\" width=\"400\" height=\"316\" class=\"alignnone size-medium wp-image-3186\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/findnextprevious_01.jpg?resize=400%2C316&amp;ssl=1 400w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/findnextprevious_01.jpg?resize=580%2C458&amp;ssl=1 580w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/findnextprevious_01.jpg?w=713&amp;ssl=1 713w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n<h2>FindPrevious \u30e1\u30bd\u30c3\u30c9 \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=\"FindPrevious \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_FindPrevious()\r\n\r\n    Dim myRng As Range\r\n    Dim firstCell As Range\r\n    Dim str As String\r\n\r\n    '\u691c\u7d22\u5024\u300c*\u8cbb\u300d\u958b\u59cb\u300cA1\u300d\u5bfe\u8c61\u300c\u5024\u300d\u6761\u4ef6\u300c\u5b8c\u5168\u4e00\u81f4\u300d\u7e26\u6a2a\u65b9\u5411\u300c\u884c\u2192\u5217\u300d\r\n    '\u65b9\u5411\u300c\u5f8c\u65b9\u691c\u7d22\u300d\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u300c\u533a\u5225\u3057\u306a\u3044\u300d\u534a\u89d2\u5168\u89d2\u300c\u533a\u5225\u3057\u306a\u3044\u300d\u66f8\u5f0f\u691c\u7d22\u300c\u3057\u306a\u3044\u300d\r\n    Set myRng = Cells.Find(\"*\u8cbb\", _\r\n                            After:=Range(\"A1\"), _\r\n                            LookIn:=xlValues, _\r\n                            LookAt:=xlWhole, _\r\n                            SearchOrder:=xlByRows, _\r\n                            SearchDirection:=xlNext, _\r\n                            MatchCase:=False, _\r\n                            MatchByte:=False, _\r\n                            searchformat:=False)\r\n    \r\n    '\u898b\u3064\u304b\u3089\u306a\u304b\u3063\u305f\u5834\u5408\u691c\u7d22\u3092\u7d42\u4e86\u3057\u307e\u3059\r\n    If myRng Is Nothing Then\r\n        \r\n        MsgBox \"\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\"\r\n        Exit Sub\r\n    \r\n    End If\r\n        \r\n    Set firstCell = myRng\r\n    \r\n    '\u6700\u521d\u306e\u691c\u7d22\u4f4d\u7f6e\u306b\u623b\u308b\u307e\u3067\u691c\u7d22\u3092\u7e70\u308a\u8fd4\u3059\r\n    Do\r\n        str = str & myRng.Address & vbLf\r\n        \r\n        '\u6b21\u3092\u691c\u7d22\uff08\u691c\u7d22\u65b9\u5411\u306f\u3001FindNext \u3068\u9006\uff09\r\n        Set myRng = Cells.FindPrevious(myRng)\r\n    \r\n    Loop While firstCell.Address <> myRng.Address\r\n    \r\n    \r\n    '\u7d50\u679c\u8868\u793a\r\n    MsgBox str\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:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/findnextprevious_02.jpg?ssl=1\" rel=\"lightbox[3184]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/findnextprevious_02.jpg?resize=400%2C319&#038;ssl=1\" alt=\"FindNext \u30e1\u30bd\u30c3\u30c9\u30fbFindPrevious \u30e1\u30bd\u30c3\u30c9 \u4f8b02\" width=\"400\" height=\"319\" class=\"alignnone size-medium wp-image-3187\" srcset=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/findnextprevious_02.jpg?resize=400%2C319&amp;ssl=1 400w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/findnextprevious_02.jpg?resize=580%2C462&amp;ssl=1 580w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/findnextprevious_02.jpg?w=710&amp;ssl=1 710w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/>\n","protected":false},"excerpt":{"rendered":"<p>FindNext \u30e1\u30bd\u30c3\u30c9 Find \u30e1\u30bd\u30c3\u30c9\u3067\u958b\u59cb\u3055\u308c\u305f\u691c\u7d22\u3092\u7d99\u7d9a\u3057\u307e\u3059\u3002\u5f15\u6570 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":3256,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[268],"tags":[511,516,517,270,63,269],"jetpack_featured_media_url":"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/findnextprevious_01-400x3161.jpg?fit=400%2C316&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-Pm","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/3184"}],"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=3184"}],"version-history":[{"count":6,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/3184\/revisions"}],"predecessor-version":[{"id":3255,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/3184\/revisions\/3255"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/3256"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=3184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=3184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=3184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}