çµåã»ã«
ä»åã¯é£æ¥ããã»ã«ã®ãã¼ã¿ãåãã§ããã°ãã»ã«çµåãããã¨ããã³ã¼ããä½ã£ã¦ã¿ããã¨æãã¾ãã ãããã ãã»ã«çµåã¯ãªãã¹ãé¿ããã¹ãã ãããã«ã»ã«çµåããããæ°ã¯æ» ãã§ã»ããã ãæåãããã®æ©è½ãç¡ããã°ããã£ãã ã¨ããããããªå£°ããâ¦
é表示ã»ã«ãçµåã»ã«ãå«ãã ç¯å²ãæ®éã«ã³ãã¼ããä»ã®ã»ã«ã¸å¤è²¼ãä»ãããã・・・・・・ã ä¸ã®ããã«ãå¤ãé£ã³é£ã³ã«ãªã£ã¦ãã¾ãã¾ãã ãããããã¯ãã§é£ã³é£ã³ã«ãªããªãããã«ãã¦ã¿ã¾ãããã ã³ã¼ãã¯ãã¡ãã§ãã Sub Tabæ¹è¡åºåãã§ã¯ãªãããã¼â¦
ã¨ã¯ã»ã«ã®æ¨æºãã¿ã³ã«ã¯ã横æ¹åã«çµåããããã¾ãããã縦æ¹åã«çµåãã¯ããã¾ãããã©ããã¦ãªãã®ããããã¾ããããå人çã«ãã®æ©è½ã欲ããã®ã§ãVBAã§ä½ã£ã¦ã¿ã¾ãã ã°ã°ãã°ããããã ãã©ãç°¡åãããªã®ã§ãèªåã§ãã£ã¦ã¿ã¾ãã Sub 縦æ¹â¦
VBAã®åå¼·ãå§ãã¦ã¿ã¦ãããã¾ã§ã«æ°ã¥ãããã¨ããç¿å¾ãããã¾ãã¾ããç¥èãªã©ãã¡ã¢ã£ã¦ãããã¨æãã¾ãã ä¸ã®ç»åã®ããã«ãA1:C3ãçµåããã»ã«ãããã¾ãã è¦ãç®ã¯ä¸ã¤ã®ã»ã«ã®ããã§ãããå®éã«ã¯9åã®ã»ã«(A1,B1,C1,A2,B2,C2,A3,B3,C3ï¼ãå«â¦
ãªã¼ããã£ã«ã¿ã¼ã使ã£ãçµãè¾¼ã¿ã§ã¯ãå¼æ°ã«é åãæå®ãã¦ããä¸ã¤ä»¥ä¸ã®é¨åä¸è´æ¡ä»¶ã§ã®çµãè¾¼ã¿ãã§ãã¾ããã§ããããªã®ã§ããªã¼ããã£ã«ã¿ã¼ã使ããã«ä¸ã¤ä»¥ä¸ã®é¨åä¸è´æ¡ä»¶ã§çµãè¾¼ã¿ãããã¦ã¿ããã¨æãã¾ããã¾ããæ¤ç´¢ã«ä¸è´ããªãè¡ãé表â¦
For Each Nextã¨DataObjectãå©ç¨ããç°¡åãªãã¯ããä½ã£ã¦ã¿ã¾ããã ç®æ¬¡ é£ã³é£ã³ã«é¸æããã»ã«ã®ãã¼ã¿ãã³ãã¼ããé£ã³é£ã³ã«é¸æããã»ã«ã«è²¼ãä»ãã ã³ã¼ãã®èª¬æ å¿ç¨ï¼ï¼çµåã»ã«ãããã¼ã¿ãã³ãã¼ããåä¸ã»ã«ã«ãã¼ã¿ãè²¼ãä»ãã å¿ç¨ï¼ï¼åâ¦
ä¾ãã°ãããªæåãã¯ãªãããã¼ãã«ããã¾ãã ãããã¢ã¯ãã£ãã»ã«ããä¸æ¹åã«nã»ã«åè²¼ãä»ãããã¯ããä½ã£ã¦ã¿ã¾ããã ã¢ã¯ãã£ãã»ã«ããä¸æ¹åã«123ã»ã«åè²¼ãä»ãã¦ã¿ã¾ãããã¯ããå®è¡ãããã¨ã«è¡¨ç¤ºãããInputBoxã«ã123ããå ¥åãOKã ãâ¦
ä»åã¯ãé¸æããç¯å²ã®ãã¼ã¿ãCSVå½¢å¼ã«ãã¦ã¯ãªãããã¼ãã¸ã³ãã¼ãããã¯ããä½ã£ã¦ã¿ã¾ããããããªæãã§ãã CSVå½¢å¼ã§ã³ãã¼ãããç¯å²ãé¸æãããã¯ããå®è¡ãã¾ãã ãããªæãã§CSVå½¢å¼ã§ã³ãã¼ããã¾ãã ã¡ã¢å¸³ãªã©ã«è²¼ãä»ãã¦ãæ¡å¼µåã.csâ¦
é¸æããã»ã«ï¼è¤æ°é¸æå¯ï¼ã®æååããã«ã³ãåºåãã§ã¯ãªãããã¼ãã«æ ¼ç´ãã¾ããé¸æããã»ã«ãçµåã»ã«ã§ããä½åãªTabãæ¹è¡ãå«ã¾ãåä¸ã»ã«ã¨åããããªæ±ãã§ã¯ãªãããã¼ãã«æ ¼ç´ã§ãã¾ãã次åæ²è¼äºå®ã®ãã¯ãã¨çµã¿åããã¦ä½¿ç¨ããããã®ãã®â¦
é常ãã¯ãªãããã¼ãã®ãã¼ã¿ãçµåã»ã«ã«è²¼ãä»ãããã¨ããã¨ï½¥ï½¥ï½¥ï½¥ï½¥ï½¥ ãã®ããã«ãããã®æä½ã¯çµåããã»ã«ã«ã¯è¡ãã¾ãããçã®ã¨ã©ã¼ã¡ãã»ã¼ã¸ã表示ãããè²¼ãä»ãããã¨ãã§ãã¾ããã ãã®ãããªã¢ã¤ã¢ã¤ã解æ¶ããã¹ãã¬ã¹ãªãä»äºãè¡ãããã«ä»â¦
ä¸ã®ç»åã®ãããªçµåã»ã«ãã³ãã¼ãã¦ã¡ã¢å¸³ãªã©ã«è²¼ãä»ããã¨ã»ã»ã» ãã®ããã«ãæå³ããªãæ¹è¡ãTabãã¯ãªãããã¼ãã«æ ¼ç´ããã¦ãããã¨ãåããã¾ããããã¯ãçµåã»ã«ãè¤æ°ã»ã«ã§æ§æããã¦ããããã§ãããç»åã®ä¾ã§ããã°ä¸ã¤ã®çµåã»ã«ã«9åã®â¦