I have the following code for assigning a filename to a string:
Is there anyway to have the default value in the file selection box be something such as the previous value of stPartnerFile. This would save the user (me) having to navigate to the file each time if it is the same file as previously used.Sub ImportMarketingPartners() Dim vaFile As Variant Dim stPartnerFile As String MsgBox ("Navigate to the file containing the marketing partner data") vaFile = Application.GetOpenFilename(Title:="Marketing partner data file:") 'Exit if cancel is selected If vaFile = 0 Then Exit Sub 'Find Filename stPartnerFile = Dir(vaFile, vbDirectory) Workbooks.Open stPartnerFile Worksheets(1).Activate End Sub
GG
Bookmarks