【发布时间】:2021-04-18 19:12:43
【问题描述】:
我正在尝试将不同工作表上循环中的每个值粘贴到某个单元格,然后为我要移动的每个值偏移 5 行。
Dim counter As Variant, carModel As Variant
Dim theRange As Range, row As Range, cell As Range
counter = Sheets("Sheet1").UsedRange.Rows.Count
Set theRange = Sheets("Sheet1").Range(Sheets("Sheet1").Cells(2, 1), Sheets("Sheet1").Cells(counter, 7))
moveDest = Sheets("Destination").Cells(1, 1)
For Each row In theRange.Rows
For Each cell In row
carModel = cell.Cells(1)
'paste this value into moveDest and move down 5 rows for the next cell loop
Next
Next
【问题讨论】:
标签: excel vba loops range offset