ã¨ã¯ã»ã«ã§ãã¼ã¿ãªã©ãå
¥åãã表ã®å
¥åãã¼ã¿ãã¯ãªã¢ãããäºããã¾ãããï¼ã§ãæ°å¼ãé¢æ°ãå
¥ã£ã¦ããã»ã«ã¾ã§æ¶ããã¦ã¯å°ãã¾ããããæ°å¼ã®å
¥ã£ã¦ããªãã»ã«ã ã空ç½ã«ããæã使ããã¨ãä»äºã®ä½æ¥å¹çãä¸ããã®ã§ãã²ãããã¦åãå
¥ãã¦ã¿ã¦ã¯ãããã§ããï¼ ã»ã«ã®è¡¨ç¤ºå½¢å¼ãè¨å®ãããExcel VBA ãµã³ãã«éãExcel VBAã®æ¸ãæ¹ããããµã³ãã«éããªãã¡ã¬ã³ã¹éãæ²è¼ãã¦ãã¾ãã ã»ã«ã®ãé
ç½®ãã¿ãã«è¨è¼ããã¦ãããã¨ãå
¨é¨æ¸ããã¦ããããã§ãã ã§ããã»ã«ã®çµå解é¤ã«å¿
è¦ãªã®ã¯ã Selection.UnMerge .MergeCells = False ã ãã§ããããä»ã¯ããã¹ã¦åé¤ãã¦ãã¾ãã¾ãã ã§ãã©ã¡ããåãæå³ãªã®ã§ãã©ã¡ããä¸æ¹ã§OK. ããã¦ããªãã¨ã»ã«ã®ããã¯ãããã¯è§£é¤ã®å¹æã¯ããã¾ãããï¼æ¸ãæ¹ï¼ãRangeãªãã¸ã§ã¯ã.Locked = True or Falseã ãã¨ã¯ã»ã«vbaãä¸ç¬ã§çµåã»ã«ã解é¤ãã¦å¤ãåãããã¯ã. TrackBack: 7 TrackBack URL Altï¼Mã§ã»ã«çµåãã§ããªã from ã¤ã³ã¹ãã©ã¯ã¿ã¼ã®ãã¿å¸³ 対象ï¼Excel97,Excel2000,Excel2002,Excel2003 ã»ã«ã®çµåã[Alt]ï¼[M]ãã¼ã§è¡ãæ¹æ³ã¨ãã»ã«ãçµåãã¦ä¸å¤®æãã[Alt]ï¼[M]ãã¼ã§è¡ãæ¹æ³ããç´¹ä»ãã¾ããã çµåã解é¤ããã¨ãã¯ãçµåããã»ã«ç¯å²ã¾ãã¯çµåããã¦ããä»»æã®ã»ã«ã®MergeCellsããããã£ã«Falseãè¨å®ãã¾ããã»ã«ç¯å²A1:C3ãçµåããã¦ããã¨ãã次ã®ã³ã¼ãã¯çµåã解é¤ãã¾ãã Sub Sample2() Range("A1").MergeCells = False End Sub ã¼ãã®ã»ã«ããã»ã«ã表ãRangeãï¾ï¾ï½¼ï¾ããªãã¸ã§ã¯ãã®Selectãï½¾ï¾ï½¸ï¾ãã¡ã½ããã§é¸æããã¨ã¨ã©ã¼ãçºçãã¾ããsheet1ãã¢ã¯ãã£ãã§sheet2ã®A1ã»ã«ãé¸æããã³ çµåããã»ã«ã解é¤ããã«ã¯ãçµåã»ã«ã®ç¯å²ã¾ãã¯çµåãããã»ã«ã®ä¸ã¤ã対象ã«ãã¾ãã ä¸ã®ä¾ãªããRange("B6:C7").MergeCells = False ãRange("B6").MergeCells = False ã¨ããã°çµåã¯è§£é¤ããã¾ãã ã¹ãã³ãµã¼ããªã³ã¯ ããã解決ããã«ã¯ææè²»ã¨ä½¿ç¨æ¥ã®ã»ã«çµåã解é¤ããªãã¨ããã¾ãããã»ã«çµåããã¦ããªãã£ãã1ç§ã§æ¸ãã ä½æ¥ãã20ç§ãããããã§ãããã®ä½æ¥ãç¹°ãè¿ãã¦ããã¨ãç¨ç士ããã¯ã©ãã§äººçééã£ãã®ãèªåãå§ãããã¨ééããªãã ãããããªã¼ããã£ã«ã¿ã¼ã解é¤ãããããã£ã«ã¿ã¼ãã¯ãªã¢ãã¦ãã¾ãã¨ãããã¾ã§ã®çµãè¾¼ã¿æ¡ä»¶ãæ¶ãã¦ãã¾ãã åããã¼ãããã¯ãvbaå
¥éãã®è¨äº. ãå¼ãã¦ä¸æ®µã«åãããã®ã§ãã試ãã¦ã¿ã¾ é¸æãã¦ããã»ã«ãåå¾ããã«ã¯ Selection ãå
¥åãã¾ãã Dim c As Range Set c = Selection ã»ã«ã®é¸æã解é¤ãã. é£ç¶ã§ã»ã«ã®çµåã¨è§£é¤ãã¨ã¯ã»ã«vbaã§ç¹°ãè¿ã ã¨ã¯ã»ã«ã§ãªã¹ããªã©ã®è¡¨ãã¤ããæã«åãå¤ã¯ã»ã«ãçµåãã¦1ã¤ã«ã¾ã¨ãããã§ãããããããããã¨å¤§å¤ãªã®ã§èªåçã«è¦ã¤ãã¦é£ç¶ã§çµåããããæããã¾ãããï¼ ¦ä¸ã®ã»ã«ä»¥å¤ã¯ç¡å¹ã«ãªã£ã¦ãã¾ãã¾ãã è²¼ãä»ãããã®ãåä¸ã»ã«ã¨æ±ºã¾ã£ã¦ããã®ãªãã å¤ãå
¥ããåã«ã»ã«ã®çµå解é¤ããã¦ããã°ããã§ãããã Sheets(1).Range("A1:A" & HENSUU).MergeCells = False ã»ã«ã®çµåã¯ãã¨ã¯ã»ã«ã§ã¯ä½¿ç¨é »åº¦ã®é«ãæä½ã®ã²ã¨ã¤ã¨ãããã§ããããããã§ã¯ãã»ã«ã®çµåã®åºæ¬ãããã¨ã¯ã»ã«ããã便å©ã«æä½ããæ¹æ³ãã»ã«çµåã®è§£é¤æ¹æ³ã¾ã§ãã¾ã¨ãã¦ãç´¹ä»ãã¾ãï¼ Excelã®ã»ã«ã¸å
¥åããããã¹ãã«éä¸ã§æ¹è¡ãæ¿å
¥ãããã¨ããå ´åãæ¹æ³ã¯Altãã¼ã使ããã®ã¨CHARé¢æ°ã§æ¹è¡ã³ã¼ããæå®ãããã®ã®2ã¤ããã¾ããã¾ããæ¿å
¥ããæ¹è¡ãåé¤ããæ¹æ³ãç´¹ä»ããã¡ãã¯CLEANé¢æ°ã使ãæ¹æ³ã¨ãç½®ææ©è½ãå©ç¨ããæ¹æ³ãããã¾ãã Excelã§ããããVBAã使ã£ã¦ã¿ããã¨ããæ¹ã対象ã«ããVBAå
¥éã§ããVBAã¨ã¯Visual Basic for Applicationsã®ç¥ã§ExcelãAccessãªã©ã§å©ç¨ã§ããããã°ã©ãã³ã°è¨èªã®1ã¤ã§ããVBAã使ããã¨ã§æåã§è¡ã£ã¦ããå®åçãªæ¥åãªã©ãèªååããããã¨ãã§ããããç¬èªã®ãã©ã¼ã ãªã©ãä½æãã¦Excel â¦