- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¦^´_ 3# b31978
¸Õ¸Õ¬Ý- '¤@¯ë¼Ò²Õµ{¦¡½X
- Option Explicit
- Sub Ex()
- Dim Rng As Range, C As Range, S, Ar(), At(), i As Integer
- Set Rng = ActiveSheet.Range("A3")
- Do While Rng <> ""
- With Rng.Offset(, 2).Resize(Rng.MergeArea.Count, 7)
- 'Rng.MergeArea Àx¦s®æªº¦X¨Ö½d³ò
- 'Rng.MergeArea.Count ¦X¨Ö½d³òªºCellsÁ`p
- If Application.CountA(.Cells) > 0 Then '.Cells :³o With ª«¥ó½d³òRangeªºCells
- '¤u§@ªí¨ç¼Æ CountA pºâ½d³ò¤º¦³¸ê®ÆªºCellsÓ¼Æ
- For Each C In .SpecialCells(xlCellTypeConstants)
- 'SpecialCells ¯S®íÀx¦s®æ (xlCellTypeConstants :¦r¦ê,¼Æ¦r )
- ReDim Ar(1 To 4) '«¸m°}¦C
- Ar(1) = Rng.Value
- Ar(2) = Cells(2, C.Column)
- Ar(3) = C
- Ar(4) = Cells(C.Row, "j")
- i = i + 1
- ReDim Preserve At(1 To i) '«¸m°}¦C:Preserve«O¯d즳ªº¤¸¯À
- At(i) = Ar
- Next
- End If
- End With
- Set Rng = Rng.End(xlDown) '¤U¤@Ó¦³¦X¨Ö½d³òªºRange
- Loop
- If i > 0 Then [M3].Resize(i, 4) = Application.Transpose(Application.Transpose(At))
- End Sub
½Æ»s¥N½X |
|