'我的代码是从打开的工作簿中的每个工作表中复制数据并粘贴到其主数据表中。
Sub CallData()
Dim CorpFile As Worksheet, CopyRg As Range, PasteRg As Range
Set CorpFile = Sheets("MasterData")
Set CopyRg = ActiveSheet.UsedRange
Set PasteRg = CorpFile.Cells(Rows.Count, 1).End(xlUp).Row + 1 'it is stuck here
For Each Sheet In ThisWorkbook
If ActiveSheet.Name <> CorpFile Then
CopyRg.Copy PasteRg
End If
Next Sheet
End Sub