ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Select File to Open (https://www.excelbanter.com/excel-programming/412450-select-file-open.html)

CrimsonPlague29

Select File to Open
 
Hello,

I'm looking for a code that when the user runs the macro it prompts them to
select the file which they want to open ???


Thanks

Dave Peterson

Select File to Open
 
Option Explicit
Sub testme01()

Dim myFileName As Variant

myFileName = Application.GetOpenFilename("Excel Files, *.xls")

If myFileName = False Then
Exit Sub
End If

'your code to open that file and do what you want.
End Sub

CrimsonPlague29 wrote:

Hello,

I'm looking for a code that when the user runs the macro it prompts them to
select the file which they want to open ???

Thanks


--

Dave Peterson


All times are GMT +1. The time now is 12:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com