这是找到的解决方案。非常感谢您的帮助!
保存条目...
Set CurSheet = ActiveWorkbook.Sheets("Entries")
maxEntries = 150
CurSheet.copy 'a new workbook is created
Set wbDest = ActiveWorkbook
wbDest.Sheets(1).Range("A1:B" & maxEntries).Value = CurSheet.Range("A1:B" & maxEntries).Value
wbDest.Sheets(1).Range("C1:C" & maxEntries).Value = CurSheet.Range("B1:B" & maxEntries).Formula
For i = 1 To maxEntries
'Removes the leading "=" from the formula
tempCell = ActiveWorkbook.Sheets(1).Range("C" & i).Formula
If Len(tempCell) > 1 Then
wbDest.Sheets(1).Range("C" & i).Value = Right(tempCell, Len(tempCell) - 1)
End If
'For empty cells
If wbDest.Sheets(1).Range("B" & i).Value = 0 Then
wbDest.Sheets(1).Range("B" & i).Value = ""
End If
Next i
...并加载它们。
fullFileName = Application.GetOpenFilename("Excel files (*.xls),*.xls", _
1, "Projekt öffnen", , False)
Workbooks.Open fullFileName
Set wbSaved = ActiveWorkbook
'Data copy
maxEntries = 150
For i = 4 To maxEntries
If Not wbSaved.Sheets(1).Range("C" & i) = "" Then 'Skip the empty lines
'Parsing
c = wbSaved.Sheets(1).Range("C" & i).Value
l = Len(c)
p = InStr(1, c, "!", vbTextCompare) 'position of the !, that separates the sheet name from the cell number
cDestSheet = Mid(c, 1, p - 1)
cDestCell = Mid(c, p + 1, -(p - l))
'Copy
wbMain.Sheets(cDestSheet).Range(cDestCell).Value = wbSaved.Sheets(1).Range("B" & i).Value
End If
Next i
wbSaved.Close False