{"id":4714,"date":"2015-12-30T09:01:55","date_gmt":"2015-12-30T00:01:55","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=4714"},"modified":"2016-01-04T10:17:50","modified_gmt":"2016-01-04T01:17:50","slug":"loflocfunction","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/loflocfunction\/","title":{"rendered":"\u958b\u3044\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u30fb\u4f4d\u7f6e\u306e\u53d6\u5f97\uff08LOF \u95a2\u6570\u30fbLoc \u95a2\u6570\uff09"},"content":{"rendered":"<h2>LOF \u95a2\u6570<\/h2>\n<div class=\"m30-l\">\n<p><a href=\"https:\/\/excelwork.info\/excel\/textopenclose\/\">Open \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/a> \u306b\u3088\u308a\u958b\u304b\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u3092\u30d0\u30a4\u30c8\u5358\u4f4d\u3092\u8868\u3059\u9577\u6574\u6570\u578b\uff08Long\uff09\u306e\u5024\u3067\u53d6\u5f97\u3059\u308b\u306b\u306f\u3001<strong>LOF \u95a2\u6570<\/strong>\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u53d6\u5f97\uff1e<\/strong><\/span><br \/>\n    <em>result<\/em> = <strong>LOF<\/strong> ( <em>filenumber<\/em> )<\/p><\/div>\n<br \/>\n<h4>\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>filenumber&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;<strong>Open \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/strong> \u3067\u3001\u5272\u308a\u5f53\u3066\u3089\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u756a\u53f7\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>result&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba\uff08\u30d0\u30a4\u30c8\u5358\u4f4d\uff09\u3092\u8868\u3059\u9577\u6574\u6570\u578b\uff08Long\uff09\u306e\u5024\u3002<\/li>\n<\/ul>\n<br \/>\n<p class=\"caution4\">\u958b\u3044\u3066\u3044\u306a\u3044\u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f <a href=\"https:\/\/excelwork.info\/excel\/funcfilelen\/\"><strong>FileLen \u95a2\u6570<\/strong><\/a> \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<\/p><\/div>\n<\/div>\n<br \/><br \/>\n<h2>Loc \u95a2\u6570<\/h2>\n<div class=\"m30-l\">\n<p><a href=\"https:\/\/excelwork.info\/excel\/textopenclose\/\">Open \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/a> \u306b\u3088\u308a\u958b\u304b\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u5185\u306e\u73fe\u5728\u306e\u8aad\u307f\u53d6\u308a\u4f4d\u7f6e\u307e\u305f\u306f\u66f8\u304d\u8fbc\u307f\u4f4d\u7f6e\u3092\u3042\u3089\u308f\u3059\u9577\u6574\u6570\u578b\uff08Long\uff09\u306e\u5024\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u3001<strong>Loc \u95a2\u6570<\/strong>\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u53d6\u5f97\uff1e<\/strong><\/span><br \/>\n    <em>result<\/em> = <strong>Loc<\/strong> ( <em>filenumber<\/em> )<\/p><\/div>\n<br \/>\n<h4>\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>filenumber&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;<strong>Open \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/strong> \u3067\u3001\u5272\u308a\u5f53\u3066\u3089\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u756a\u53f7\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>result&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u73fe\u5728\u306e\u8aad\u307f\u53d6\u308a\u4f4d\u7f6e\u307e\u305f\u306f\u66f8\u304d\u8fbc\u307f\u4f4d\u7f6e\u3092\u793a\u3059\u9577\u6574\u6570\u578b\uff08Long\uff09\u306e\u5024\u3067\u3001<strong>Open \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/strong>\u3092\u4f7f\u7528\u3057\u3066\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u6642\u306e\u30e2\u30fc\u30c9\u306b\u3088\u308a\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n<table>\n<tr>\n<td align = \"center\" width=\"250\" bgcolor=\"#ffffccc\"><strong>\u30e2\u30fc\u30c9<\/strong><\/td>\n<td align = \"center\" width=\"400\" bgcolor=\"#ffffccc\"><strong><em>result<\/em> \u306e\u5185\u5bb9<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"250\">\u30e9\u30f3\u30c0\u30e0\u30a2\u30af\u30bb\u30b9\u30e2\u30fc\u30c9\uff08Random\uff09<\/td>\n<td width=\"400\">\u6700\u5f8c\u306b\u8aad\u307f\u53d6\u308a\u307e\u305f\u306f\u66f8\u304d\u8fbc\u307f\u3092\u884c\u3063\u305f<span class=\"red\">\u30ec\u30b3\u30fc\u30c9\u306e\u756a\u53f7<\/span><\/td>\n<\/tr>\n<tr>\n<td width=\"250\">\u30d0\u30a4\u30ca\u30ea\u30e2\u30fc\u30c9\uff08Binary\uff09<\/td>\n<td width=\"400\">\u6700\u5f8c\u306b\u8aad\u307f\u53d6\u308a\u307e\u305f\u306f\u66f8\u304d\u8fbc\u307f\u3092\u884c\u3063\u305f<span class=\"red\">\u30d0\u30a4\u30c8\u306e\u4f4d\u7f6e<\/span><br \/>\n\t    <\/tr>\n<tr>\n<td width=\"250\">\u30b7\u30fc\u30b1\u30f3\u30b7\u30e3\u30eb\u5165\u529b\u30e2\u30fc\u30c9\uff08Input\uff09<br \/>\u30b7\u30fc\u30b1\u30f3\u30b7\u30e3\u30eb\u51fa\u529b\u30e2\u30fc\u30c9\uff08Output\uff09<br \/>\u8ffd\u52a0\u30e2\u30fc\u30c9\uff08Append\uff09<\/td>\n<td width=\"400\">\u30d5\u30a1\u30a4\u30eb\u5185\u306e\u73fe\u5728\u306e\u30d0\u30a4\u30c8\u4f4d\u7f6e\u3092 128 \u3067\u5272\u3063\u305f\u5024\u3002<\/td>\n<\/tr>\n<\/table>\n<p>\n      <\/li>\n<\/ul><\/div>\n<\/div>\n<br \/><br \/>\n<h2>LOF \u95a2\u6570\u30fbLoc \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=\"LOF \u95a2\u6570\u30fbLoc \u95a2\u6570 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_LOF_Loc()\r\n\r\n    Dim FileName As String\r\n    Dim FNum As Integer\r\n    Dim str As String\r\n    Dim mySize As Integer\r\n    \r\n    FileName = \"C:\\Documents\\mydata\\file01.txt\"\r\n    FNum = FreeFile\r\n    \r\n    '\u30d5\u30a1\u30a4\u30eb\u3092\u30d0\u30a4\u30ca\u30ea\u30e2\u30fc\u30c9\u3067\u958b\u304f\r\n    Open FileName For Binary As #FNum\r\n    \r\n    '20\u6587\u5b57\u5206\u3092\u53d6\u5f97\u3057 \u5909\u6570 str \u306b\u683c\u7d0d\r\n    str = Input(20, #FNum)\r\n    \r\n    '\u73fe\u5728\u306e\u8aad\u307f\u53d6\u308a\u4f4d\u7f6e\u3068\u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u3092\u8868\u793a\r\n    '\uff08\u3044\u305a\u308c\u3082\u30d0\u30a4\u30c8\u5358\u4f4d\uff09\r\n    MsgBox Loc(FNum) & \" \/ \" & LOF(FNum) & \" \u30d0\u30a4\u30c8\"\r\n    \r\n    '\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u308b\r\n    Close #FNum\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\/12\/loflocfunction01.jpg?ssl=1\" rel=\"lightbox[4714]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/12\/loflocfunction01.jpg?resize=168%2C155&#038;ssl=1\" alt=\"LOF \u95a2\u6570\u30fbLoc \u95a2\u6570\" width=\"168\" height=\"155\" class=\"alignnone size-full wp-image-4715\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n","protected":false},"excerpt":{"rendered":"<p>LOF \u95a2\u6570 Open \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8 \u306b\u3088\u308a\u958b\u304b\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u3092\u30d0\u30a4\u30c8\u5358 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":4715,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[675],"tags":[693,737,736,731,63,38],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/12\/loflocfunction01.jpg?fit=168%2C155&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-1e2","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/4714"}],"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=4714"}],"version-history":[{"count":7,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/4714\/revisions"}],"predecessor-version":[{"id":4817,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/4714\/revisions\/4817"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/4715"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=4714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=4714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=4714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}