0
Sub Sample()

Dim wsI As Worksheet, wsO As Worksheet, ws2 As Worksheet
Dim LastRow As Long, i As Long, j As Long

Set wsI = Sheets("EC6")
Set wsO = Sheets("2")

 LastRow = wsI.Range("A" & Rows.Count).End(xlUp).Row

j = 1

With wsI
    For i = 1 To LastRow
        wsI.Rows(i).Copy wsO.Rows(j)

        j = j + 1
    Next i
End With
End Sub

如何仅将 VALUE 从 wsI 复制到 wsO ?

4

1 回答 1

0

如果您的目标工作表已经存在(即您有 31 个工作表,命名为 1 到 31):

Dim wsI As Worksheet, wsO As Worksheet, ws2 As Worksheet
Dim LastRow As Long, i As Long, j As Long

Set wsI = Sheets("EC6")

Set wsO = Sheets(wsI.Cells(49, 1).Value)

LastRow = wsI.Range("A" & Rows.Count).End(xlUp).Row

j = 1

With wsI
    For i = 1 To LastRow
        wsI.Rows(i).Copy wsO.Rows(j)

        j = j + 1
    Next i
End With
于 2012-10-23T13:57:56.000 回答