엑셀 비주얼베이직 문의
-
게시물 수정 , 삭제는 로그인 필요
여러개 Sheet를 비주얼베이직 사용하여 한번에 시트별로 저장하고 싶은데
아래 내용을 입력하고 F5를 눌렀는데 디바이스 오류라고 뜨면서 처리가 안됩니다
엑셀 자료 첨부하였습니다
도와주세요!!
Sub ExportFile()
Dim FDialog As FileDialog
Dim FPath As String
Dim Sht As Worksheet
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set FDialog = Application.FileDialog(msoFileDialogFolderPicker)
FDialog.InitialFileName = ThisWorkbook.Path
If FDialog.Show = -1 Then
FPath = FDialog.SelectedItems(1)
End If
If FPath <> "" Then
For Each Sht In ThisWorkbook.Sheets
Sht.Copy
ActiveWorkbook.SaveAs FPath & "\" & Sht.Name & ".xlsx"
ActiveWorkbook.Close
Next Sht
End If
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
#엑셀 비주얼베이직 #엑셀 비주얼베이직 실행 #엑셀 비주얼베이직 단축키 #엑셀 비주얼베이직 오류 #엑셀 비주얼베이직 한글 밀림 #엑셀 비주얼베이직 기초 #엑셀 비주얼베이직 문법 #엑셀 비주얼베이직 한글 입력 오류 #엑셀 비주얼베이직 함수 #엑셀 비주얼베이직 설치