Dim startId As Long
Private Sub CommandButton1_Click()
startId = 11
' For i = 1 To 64 Step 1
' Sheet1.Cells(1, startId + i) = Sheet1.Cells(i, 2)
' Sheet1.Cells(2, startId + i) = Sheet1.Cells(i, 4)
' Sheet1.Cells(3, startId + i) = Sheet1.Cells(i, 6)
' Sheet1.Cells(4, startId + i) = Sheet1.Cells(i, 8)
' Next
Dim usea As Long
Dim moda As Long
Dim linea As Long
linea = 0
For i = 1 To 1023 Step 1
moda = i Mod 4
If moda = 0 Then
usea = 8
End If
If moda = 1 Then
usea = 2
linea = linea + 1
End If
If moda = 2 Then
usea = 4
End If
If moda = 3 Then
usea = 6
End If
Sheet1.Cells(i, 11) = Sheet1.Cells(linea, usea)
Next
' Sheet1.Cells(1, 11) = Sheet1.Cells(1, 2)
'Sheet1.Cells(2, 11) = Sheet1.Cells(1, 4)
' Sheet1.Cells(3, 11) = Sheet1.Cells(1, 6)
' Sheet1.Cells(4, 11) = Sheet1.Cells(1, 8)
'Sheet1.Cells(5, 11) = Sheet1.Cells(2, 2)
'Sheet1.Cells(6, 11) = Sheet1.Cells(2, 4)
' Sheet1.Cells(7, 11) = Sheet1.Cells(2, 6)
' Sheet1.Cells(8, 11) = Sheet1.Cells(2, 8)
' Sheet1.Cells(9, 11) = Sheet1.Cells(3, 2)
' Sheet1.Cells(10, 11) = Sheet1.Cells(3, 4)
'Sheet1.Cells(11, 11) = Sheet1.Cells(3, 6)
' Sheet1.Cells(12, 11) = Sheet1.Cells(3, 8)
End Sub
904

被折叠的 条评论
为什么被折叠?



