ilyaskazi
05-28-2005, 06:09 AM
Object: 2 txtboxes, 2 Directory Open button (Browse button)
In my Userform, near txtbox1, opnBtn1 is kept and likewise to txtbox2.
When I browse the path for excel file by clicking opnBtn1, the path and file name is stored in txtbox1 and likewise to txtbox2.
this is the code...
Private Sub opnBtn1_Click()
Dim File1name
File1name = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
If File1name <> False Then
Me.txtbox1.Text = File1name
End If
End Sub
...but i dont want like this to happen with txtbox2, while browsing upon clicking opnBtn2.
I don't need to search again for selecting next file by clicking opnBtn2. I need, upon clicking this button, it should automatically locate the path from the txtbox1 to open any next file for txtbox2. Also vice versa upon clicking opnBtn1, get the location from txtbox2, if the value is not null.
In my Userform, near txtbox1, opnBtn1 is kept and likewise to txtbox2.
When I browse the path for excel file by clicking opnBtn1, the path and file name is stored in txtbox1 and likewise to txtbox2.
this is the code...
Private Sub opnBtn1_Click()
Dim File1name
File1name = Application.GetOpenFilename("Excel Files (*.xls), *.xls")
If File1name <> False Then
Me.txtbox1.Text = File1name
End If
End Sub
...but i dont want like this to happen with txtbox2, while browsing upon clicking opnBtn2.
I don't need to search again for selecting next file by clicking opnBtn2. I need, upon clicking this button, it should automatically locate the path from the txtbox1 to open any next file for txtbox2. Also vice versa upon clicking opnBtn1, get the location from txtbox2, if the value is not null.