andycrfc13
New member
- Local time
- Yesterday, 17:10
- Joined
- Aug 12, 2010
- Messages
- 9
Hello,
I'm a beginner in using VBA and was wondering if anyone could help in assisting modifying some simple code. The code i have at the minute does the job that I intend it to do however it is on a predefined file.
Private Sub Command27_Click()
Dim FileName As String
Dim f As Integer
FileName = "C:\Documents and Settings\..."
f = FreeFile 'Get a file handle
Open FileName For Input As f 'Open the file
Me.Results = Input$(LOF(f), f) 'Read entire file into text box
Close f
End Sub
I would like to modify the code to ask the user to select the file they wish to use, however i am unsure what i need to change.
Thanks in advance
I'm a beginner in using VBA and was wondering if anyone could help in assisting modifying some simple code. The code i have at the minute does the job that I intend it to do however it is on a predefined file.
Private Sub Command27_Click()
Dim FileName As String
Dim f As Integer
FileName = "C:\Documents and Settings\..."
f = FreeFile 'Get a file handle
Open FileName For Input As f 'Open the file
Me.Results = Input$(LOF(f), f) 'Read entire file into text box
Close f
End Sub
I would like to modify the code to ask the user to select the file they wish to use, however i am unsure what i need to change.
Thanks in advance
Last edited: