1
내가 내 문제의 해결은 매우 간단하다고 생각 작동하지 않습니다 ...하지만 내가 잘못하고있는 중이 야 모르겠어요 .. :/와 워크 시트를 반환하는 것은
감사를 도와!
Function getWorksheet(SheetNumber As Integer) As Worksheet
Dim workbook As workbook
Dim file As Variant
file = ShowFileDialogAndFindFile
Set workbook = Workbooks.Open(file, True, True)
getWorksheet = workbook.Worksheets(SheetNumber)
End Function
Function ShowFileDialogAndFindFile() As Variant
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFilePicker)
Dim vrtSelectedItem As Variant
With fd
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
ShowFileDialog = vrtSelectedItem
Next vrtSelectedItem
Else
End If
End With
Set fd = Nothing
End Function
내가 다른 MODUL에서 호출하고 있습니다 : 당신은이 작업을 수행하는 키워드 Set
를 사용할 필요가
Dim sheetExtern As Worksheet
sheetExtern = getWorksheet(1)