One way...
Option Explicit
Sub testme()
Dim myFolder As String
Dim myCurDrivePath As String
Dim wkbk As Workbook
Dim myFileName As Variant
myCurDrivePath = CurDir
myFolder = "C:\temp"
ChDrive myFolder
ChDir myFolder
myFileName = Application.GetOpenFilename(Filefilter:="Excel Files, *.xls")
ChDrive myCurDrivePath
ChDir myCurDrivePath
If myFileName = False Then
'user hit cancel
Exit Sub
End If
Set wkbk = Workbooks.Open(Filename:=myFileName)
With wkbk
.Worksheets(1).Copy _
befo=ThisWorkbook.Worksheets(1)
.Close savechanges:=False
End With
End Sub
You don't need to build a userform. Excel's VBA has .getopenfilename that you
can use.
sal21 wrote:
How i can:
insert into MyWbook a button to show into userform the list of wbooks
present into c:\mydir\
All wbooks have the name similar:
ESTINTI_4543.xls
ESTINTI_4500.xls
ESTINTI_4501.xls
ESTINTI_4502.xls
ecc....
(Naturally not show into list of the userform the suffix .xls)
After i have clicked on one wbook listed into userform, copy the sheet
of wbook clicked, into wbook MyWbook .xls.
All wbooks into dir MyDir contain only one sheet named: DARE_GLOB
(EPUR)...
--
sal21
------------------------------------------------------------------------
sal21's Profile: http://www.excelforum.com/member.php...fo&userid=2040
View this thread: http://www.excelforum.com/showthread...hreadid=469667
--
Dave Peterson