Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
If any specific #s are present in range, show each in another cell Steve Excel Worksheet Functions 6 June 24th 09 02:57 PM
Checking whether a value in a list is present in a second list [email protected] Excel Discussion (Misc queries) 5 June 1st 07 02:30 PM
List all sheets present in Workbook Jeff Excel Worksheet Functions 6 November 9th 06 09:03 PM
How to identify entries in a matrix also present in another list larkindale Excel Worksheet Functions 2 September 16th 05 07:07 PM
How do I show dates older than present date? Sissyfirst Excel Worksheet Functions 1 July 12th 05 09:56 PM


All times are GMT +1. The time now is 07:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"