如何在Excel中使用VBA或使用條件語句複製行3或4次,然後將值從一個單元複製並粘貼到另一個單元。如何在Excel中複製行並將值從一個單元格複製到另一個單元格?
這是數據看起來的樣子
,這我怎麼想落得。
更新:下面我想複製合併到行代碼,列沒有176,177,178,179,180它的偉大工程,但除去1列和176之間的山坳所有列。
Sub SortMacro()
Dim SourceSheet As Worksheet
Dim OutSheet As Worksheet
Set SourceSheet = ActiveSheet
Set OutSheet = Sheets.Add
With SourceSheet
Out_i = 1
For r = 1 To .Cells(Rows.Count, 176).End(xlUp).Row
For i = 176 To 180 'or For each i in Array(3,4,5)
OutSheet.Cells(Out_i, 1) = .Cells(r, 1)
OutSheet.Cells(Out_i, 176) = .Cells(r, i)
Out_i = Out_i + 1
Next
Next
End With
End Sub
變化__OutSheet.Cells(Out_i,176)= .Cells(R,I)__到__OutSheet.Cells(Out_i,2)= .Cells(R,I)__ – Radek 2014-11-23 16:52:11