excel VBA 一数据引用另一张表的数据应该怎么写

2024-11-02 06:41:40
推荐回答(2个)
回答(1):

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row >= 2 And Target.Row <= 1000 And _
Cells(Target.Row, 8) < Date Then
Application.EnableEvents = False
For i = 9 To 18
Cells(Target.Row, i) = Sheet2.Cells(Target.Row, i).Value
Next
Application.EnableEvents = True
End If
End Sub

回答(2):

是两个工作簿还是工作表?
两个的程序不一样