0

私はその前に、行を列に、列を行に参照することを試みました。それらは完璧ではありませんが、機能します。しかし、ジャンプするときに問題があり、本当に助けが必要です。

ここに画像の説明を入力してください

私のコードはエラーを返しませんが、値が「=」のセルは1つだけです。

ここに画像の説明を入力してください

4

1 に答える 1

1

これはあなたのために働きますか?

*ユーザーがセル値だけでなくセルへの参照を必要とする要素に追加されました。

Sub Row2ColumnReferance()

Dim rRangeCopy As Range, CRangePaste As Range
Dim jump As Integer

'get input
Set rRangeCopy = Application.InputBox("Select Copy Range", "Transform", Type:=8)
Set CRangePaste = Application.InputBox("Select Destination Range", "Transform", Type:=8)
jump = Application.InputBox("Enter")

Dim cel As Range, intCnt As Integer

'place new cells
intCnt = 1
For Each cel In rRangeCopy
    CRangePaste.Cells(intCnt, 1).Formula = "=" & cel.Address(False, False)
    intCnt = intCnt + 1
Next

Dim intRows As Integer

'insert space
intCnt = CRangePaste.Rows.Count
For intRows = intCnt To 2 Step -1
    Range(CRangePaste.Cells(intRows, 1), CRangePaste.Cells(intRows + jump - 1, 1)).Insert shift:=xlDown
Next

End Sub
于 2012-05-18T17:09:25.673 に答える