So I am trying to use a userform to pass in an answer as a means to search for a file within a given folder. For example this is what I want to do.
Choose File 1 __
Choose File 2 __
Button
I want to be able to enter file paths in the textbox and then pass them as parameters to a separate macro which will load data into the current workbook. However, I cant find anything about this anywhere.
Can someone show a basic example of something like this?
Awesome. I'm still confused by how to pass this from a userform.
So I have
Private Sub TextBox1_Change()
End Sub
Private Sub TextBox2_Change()
End Sub
how do I specify the answer as a global variable that I can pass to the GetDataFromSelectedFile macro?
This is the userform layout:
LabelTextBox1 TextBox LabelTextBox2 Textbox
Command Button
Subs under the userform:
Private Sub CommandButton1_Click()
Call ProcessSelectedFile - This is the same as earlier posted
Call RemoveDups - doesnt really matter what it does since it works after
ProcessSelectedFile is implemented
End Sub
Private Sub TextBox1_Change() 'ChDrive (sPath) ' This is where I was unclear about what you were doing 'ChDir (sPath) 'vOpen_File = Application.GetOpenFilename
End Sub
Private Sub TextBox2_Change()
End Sub
Basically if you can just show me how to log the answer in the userform and pass it to ProcessSelectedFile and then make the command button click do those two macros it will work.
Thanks