- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 257
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-27
|
¦^´_ 6# billchenfantasy
Y¨Ì§Aªº½d¨Ò»¡©ú¬On²¾°£«½Æ(ì22¦C¸ê®Æ¡A¾ã²z«á¬°15¦C)
¬O¦³¥ý±N³Ì¥½2Äæ¦V«e²¾°Ê¡A¥u¬O¦³¦A«ì´_컪¦Ó¥H- Sub ex()
- Dim Rng As Range, A As Range, C As Range
- Set d = CreateObject("Scripting.Dictionary")
- d("first") = Array("Mplan_no", "Mdate") '·s¼ÐÃD
- [A1].End(xlToRight).Offset(, -1).Resize(, 2).EntireColumn.Cut '³Ì«á2Äæ°Å¤U
- [C1].Insert '¦bCÄæ´¡¤J°Å¤UªºÀx¦s®æ
- For Each A In Range([A2], [A2].End(xlDown))
- mystr = "": x = "": y = ""
- Set Rng = A.EntireRow.SpecialCells(xlCellTypeConstants, xlNumbers) '¥H¤é´Á§@¬°°ò·Ç
- For Each C In Rng
- 'mystr = IIf(mystr = "", C.Offset(, -1) & C, mystr & C.Offset(, -1) & C) 'Yn±Æ°£«½Æ«h¨Ï¥Î¦¹¬°¦r¨å¯Á¤Þ
- x = IIf(x = "", C.Offset(, -1), x & " " & C.Offset(, -1))
- y = IIf(y = "", C, y & " " & C)
- Next
- s = s + 1
- d(s) = Array(x, y)
- 'd(mystr) = Array(x, y) 'Yn±Æ°£«½Æ«h¨Ï¥Î¦¹¬°¦r¨å¯Á¤Þ
- Next
- [C:D].Cut [A1].End(xlToRight).Offset(, 1) '±NC:DÄæ°Å¤U¶K¦^¸ê®Æªí³Ì¥½ºÝ
- [C:D].Delete 'C:D°Å¤U«áÅܦ¨ªÅ¥ÕÄæ¡A©Ò¥H±N¨ä§R°£¡A¦^ÂЦ¨ì¸ê®Æªí
- [A1].End(xlDown).Offset(3).Resize(d.Count, 2) = Application.Transpose(Application.Transpose(d.items))
- End Sub
½Æ»s¥N½X |
|