VBA(Excel)

VBA(Excel), 파일 선택해서 경로 보기

hwangyoungjae 2016. 5. 2. 10:46

Sub Main()
    Dim fd As FileDialog
    Set fd = Application.FileDialog(msoFileDialogFilePicker)
    Dim vrtSelectedItem As Variant
    With fd
        If .Show = -1 Then
            For Each vrtSelectedItem In .SelectedItems
                MsgBox "The path is: " & vrtSelectedItem
            Next vrtSelectedItem
        Else
        End If
    End With
    Set fd = Nothing
End Sub