我有一个可以更新的工作表。用户输入一个表号进行实时更新,然后宏将查看Column 9 (I)
并复制B:D
该行并将其粘贴到前表(封面)的单元格中。这将一直持续到数据表中的所有数据都用完为止。
Sub Update_Current()
Dim Page
Dim lastrow As Long, i As Long
Dim ws As Worksheet
lastrow = ActiveSheet.Range("D1000").End(xlUp).Row + 1
Page = InputBox("Which week would you like to update?")
If Page = 1 Then
Worksheets("Week(1)").Select
For i = 6 To 100
If ws.Cells(i, 9) = "2" Or ws.Cells(i, 9) = "3" Then
Range("i,2:1,4").Copy
{TORN ON WHAT GOES HERE}
End If
Next i
End If
End Sub