Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
show list of wbooks present into a dir
How i can: insert into MyWbook a button to show into userform the list of wbook 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 shee of wbook clicked, into wbook MyWbook .xls. All wbooks into dir MyDir contain only one sheet named: DARE_GLO (EPUR).. -- sal2 ----------------------------------------------------------------------- sal21's Profile: http://www.excelforum.com/member.php...nfo&userid=204 View this thread: http://www.excelforum.com/showthread.php?threadid=46966 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
show list of wbooks present into a dir
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
If any specific #s are present in range, show each in another cell | Excel Worksheet Functions | |||
Checking whether a value in a list is present in a second list | Excel Discussion (Misc queries) | |||
List all sheets present in Workbook | Excel Worksheet Functions | |||
How to identify entries in a matrix also present in another list | Excel Worksheet Functions | |||
How do I show dates older than present date? | Excel Worksheet Functions |