- ©«¤l
- 1018
- ¥DÃD
- 15
- ºëµØ
- 0
- ¿n¤À
- 1058
- ÂI¦W
- 0
- §@·~¨t²Î
- win7 32bit
- ³nÅ骩¥»
- Office 2016 64-bit
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ®ç¶é
- µù¥U®É¶¡
- 2012-5-9
- ³Ì«áµn¿ý
- 2022-9-28
|
¦^´_ 1# joslau - Sub Ex()
- Dim rngSelect As Range, sMerge As String
-
- SELECT_RANGE_AGAIN:
- On Error Resume Next
- Set rngSelect = Application.InputBox(prompt:="½Ð¿ï¾Ü³æ¦C½d³ò©Î³æÄæ½d³ò", Default:=Selection.Address, Type:=8)
- On Error GoTo 0
- If rngSelect Is Nothing Then Exit Sub
- rngSelect.Select
-
- With rngSelect
- If .Rows.Count = 1 And .Columns.Count = 1 Then '³æ®æ
- sMerge = rngSelect.Value
- ElseIf .Rows.Count = 1 And .Columns.Count > 1 Then '³æ¦C
- sMerge = Join(Application.Transpose(Application.Transpose(rngSelect.Value)), ",")
- ElseIf .Rows.Count > 1 And .Columns.Count = 1 Then '³æÄæ
- sMerge = Join(Application.Transpose(rngSelect.Value), ",")
- Else
- GoTo SELECT_RANGE_AGAIN
- End If
- End With
-
- With New DataObject '»Ý¤Þ¥Î Microsoft Form Object Library
- .SetText sMerge
- .PutInClipboard
- End With
- End Sub
½Æ»s¥N½X |
|