Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Tim, It appears no one has provided a solution for you. I've been unavailable for a while, so sorry for the delay... This may work for you (it's untested); see my addional code added in BOLD: Code: -------------------- Sub ConvertFiles() Dim vrtSelectedItem As Variant Dim FileToOpen As String 'Declare a variable as a FileDialog object. Dim fd As FileDialog Set fd = Application.FileDialog(msoFileDialogFolderPicker) fd.Title = "Cool Application" fd.InitialFileName = "My Documents" If fd.Show = -1 Then For a = 1 To fd.SelectedItems.Count MsgBox fd.SelectedItems(a) Dim NextFile As String NextFile = Dir(fd.SelectedItems(a) & "\*detail*.*") Workbooks.Open Filename:=NextFile ActiveWorkbook.SaveAs Filename:= _ NextFile & ".wk4", _ FileFormat:=xlWK4, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False NextFile = Dir() Do While NextFile < "" Workbooks.Open Filename:=NextFile ActiveWorkbook.SaveAs Filename:= _ NextFile & ".wk4", _ FileFormat:=xlWK4, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False NextFile = Dir() Loop Next ' CREATE A NEW WORKBOOK AND LIST/COUNT FILES... WORKBOOKS.ADD FOR A = 1 TO FD.SELECTEDITEMS.COUNT ' ADD FILE NAME TO SHEET... ACTIVESHEET.CELLS(A, 1).VALUE = FD.SELECTEDITEMS(A) NEXT A ' ADD FILE COUNT TO SHEET... ACTIVESHEET.CELLS(A + 1, 1).VALUE = \"TOTAL FILES: \" & FD.SELECTEDITEMS.COUNT End If End Sub -------------------- Hope this helps, theDude -- theDude ------------------------------------------------------------------------ theDude's Profile: http://www.excelforum.com/member.php...o&userid=16550 View this thread: http://www.excelforum.com/showthread...hreadid=372302 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Listing Names in a spreadsheet | Excel Discussion (Misc queries) | |||
Listing names and id and corresponding software | Excel Worksheet Functions | |||
Listing the names of your worksheets | Excel Discussion (Misc queries) | |||
listing all names in a worksheet | Excel Discussion (Misc queries) | |||
Listing of Sheet names | Excel Worksheet Functions |