ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] Àx¦s®æ¦X¨Ö

[µo°Ý] Àx¦s®æ¦X¨Ö

ºô­¶¸ê®Æ¤U¸ü¦ÜExcel,³¡¥÷Äæ¦ì­ì¬°¦X¨Öªº«oÅܬ°µL¦X¨Ö,¬O§_¥i¨Ï¥Îµ{¦¡¦A±NÀx¦s®æ°µ¦X¨Ö°Ê§@



Àx¦s®æ¦X¨Ö.zip (2.6 KB)

¦^´_ 6# Hsieh

­ì¥»¥ÎCurrentRegion«h¥i¶Ç¦^¥ÑªÅ¥Õ®æ¤l³ò°_¨Óªº¤@­Ó½d³ò
¥Ø«e°ÝÃD¤w¸Ñ¨M,¦A¦¸·PÁÂH¤jªº«ü¾É

TOP

¦^´_ 5# jcchiang
  1. Sub ex()
  2. Dim Rng As Range
  3. With Range("A1").CurrentRegion
  4. .UnMerge
  5.    For i = 1 To .Columns.Count
  6.    If Application.CountBlank(.Columns(i)) > 0 Then
  7.      Set Rng = .Columns(i).SpecialCells(xlCellTypeBlanks)
  8.      For Each a In Rng.Areas
  9.        Union(a, a.Offset(-1, 0)).Merge
  10.      Next
  11.     End If
  12.    Next
  13. End With
  14. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 4# Hsieh

µ{¦¡«ü¥O¯uªº«Ü¼F®`,¥u¬O¦h¥[¤@­Ó§PÂ_,§Y¥i±N°ÝÃD¸Ñ¨M,·PÁÂH¤jªº«ü¾É
¥t¦³¤@­Ó°ÝÃD¬O,¸ê®Æªº¦æ¦C¤£¤@©w¬°19¦æ
¦pªG±NRange("A1:G19"),§ï¬°Range("A:G"),·|¾É­P³Ì«á¤@µ§±N«á­±©Ò¦³ªºªÅ¥ÕÀx¦s®æ³£¦X¨Ö
¬O§_¦³¦ó«ü¥O¥i¥H¥ý§PÂ_¥X¦³¦h¤Ö¦æ,¦A±N¼Æ¦r±a¤JRange("A1:G?)¤º©O

TOP

¦^´_ 3# jcchiang
  1. Sub ex()
  2. Dim Rng As Range
  3. With Range("A1:G19")
  4. .UnMerge
  5.    For i = 1 To .Columns.Count
  6.    If Application.CountBlank(.Columns(i)) > 0 Then
  7.      Set Rng = .Columns(i).SpecialCells(xlCellTypeBlanks)
  8.      For Each a In Rng.Areas
  9.        Union(a, a.Offset(-1, 0)).Merge
  10.      Next
  11.     End If
  12.    Next
  13. End With
  14. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 2# Hsieh
¦pªG¦³³sÄò2­Ó­n¦X¨Öªº,²Ä¤G­Ó·|³Q·|³Q²Ä¤@­Ó¤@¨Ö¦X¨Ö

Test4³QTest3¦X¨Ö¤F

Àx¦s®æ¦X¨Ö1.jpg (207.86 KB)

Àx¦s®æ¦X¨Ö1.jpg

TOP

¦^´_ 1# jcchiang
  1. Sub ex()
  2. Application.DisplayAlerts = False
  3. Range("A1:G19").UnMerge
  4. For i = 1 To Range("A1:G19").Columns.Count
  5.    If Application.CountBlank(Range("A1:G19").Columns(i)) > 0 Then
  6.       Set Rng = Range("A1:G19").Columns(i).SpecialCells(xlCellTypeBlanks)
  7.       Union(Rng, Rng.Offset(-1, 0)).Merge
  8.    End If
  9. Next
  10. Application.DisplayAlerts = True
  11. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : °ß¨ä´L­«¦Û¤vªº¤H¡A¤~§ó«i©óÁY¤p¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD