Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi I have a list of files in an excel sheet in the first column I would like
to know is there a way I can get excel to search for these files by giving it a dirctory and then it would copy the files to a directory I set, so say I have the following in an excel document 15632.dxf 55555.dxf 95854.dxf now they are under directory X and the directory I want them to be copier to is XX is there a way to do this, I would appreciate any help Thanks. Ali |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Aliandro,
You need the 'filecopy' command in something like this Sub CopyThoseFiles() Dim sFolderFrom As String Dim sFolderTo As String Dim sFileName As String ' sFolderFrom = "X" sFolderTo = "XX" Do While Not IsEmpty(ActiveCell) sFileName = ActiveCell.Value If Len(Dir(sFolderFrom & "\" & sFileName)) 0 Then ' Only if file existst FileCopy sFolderFrom & "\" & sFileName, sFolderTo End If ActiveCell.Offset(1, 0).Select Loop End Sub GoodLuck, Woutre HM "Aliandro" wrote in message ... Hi I have a list of files in an excel sheet in the first column I would like to know is there a way I can get excel to search for these files by giving it a dirctory and then it would copy the files to a directory I set, so say I have the following in an excel document 15632.dxf 55555.dxf 95854.dxf now they are under directory X and the directory I want them to be copier to is XX is there a way to do this, I would appreciate any help Thanks. Ali |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copy and pasting one file into several different folders | Excel Discussion (Misc queries) | |||
how to open a file with a same name but in different folders | Excel Discussion (Misc queries) | |||
Creating folders and subfolders from excel file list | Excel Discussion (Misc queries) | |||
List folders to file | Excel Discussion (Misc queries) | |||
Web Folders - Excel file -- asks for password again | Excel Programming |