これはトリックを行うべきだと思います。基本的には、範囲変数を使用して選択を処理します。次に、配列に選択されたセルの値を入力します。 CSVはあなたの結果を含む変数です。
ここではselectedCells
は変数で、Excelでは特別な機能ではありません。
[このコードは、Excel 2002で働いていた - 他のバージョンでわからない。]
Dim selectedCells As Range
Dim rng As Range
Dim i As Integer
Dim values() As String
Dim CSV As String
' you may need some error handling here in case your selection
' isn't a range
Set selectedCells = Selection
ReDim values(selectedCells.Count - 1)
i = 0
For Each rng In selectedCells
' you may want some error handling here when populating the array
values(i) = CStr(rng.Value)
i = i + 1
Next rng
CSV = Join(values, ",")
ヒント:それ以降のバージョンのExcelでLong'として '私を宣言することをお勧めします。) –