Sub GetImportFileName()
Dim Finfo As String
Dim FilterIndex As Long
Dim Title As String
Dim FileName As Variant
' Set up list of file filters
Finfo = "Excel Files (*.xlsx),*.xlsx"
' Display *.* by default
FilterIndex = 5
' Set the dialog box caption
Title = "Escolhe caminho e ficheiro"
'Get the filename
FileName = Application.GetOpenFilename(Finfo, _
FilterIndex, Title)
' Handle return info from dialog box
If FileName = False Then
MsgBox "Nenhum ficheiro foi escolhido."
Else
MsgBox "You selected " & FileName
End If
End Sub
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter