Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I figured out what I needed. This is the macro that works:
ub Transfer() newPath = InputBox("Please enter the directory name", "Directory Name") ' For i = 2 To Cells(Rows.Count, "A").End(xlUp).row currentPath = Cells(i, "A").Value Filename = Cells(i, "G").Value Debug.Print currentPath, Filename, newPath, Filename 'copy currentPath & "\" & Filename As newPath & "\" & Filename FileCopy currentPath & "\" & Filename, newPath & "\" & Filename Next i End Sub "Bob Phillips" wrote: Something like currentPath = "C:\myFiles\" newPath = "Y:\abc\" For i = 2 To Cells(Rows.Count, "A").End(xlUp).row Name currentPath & Cells(i,"A").Value _ newPath & Cells(i,"A").Value next i -- HTH Bob Phillips (replace xxxx in the email address with gmail if mailing direct) "Barb Reinhardt" wrote in message ... I want to create a macro to move files from one server to another. Basically, I'd want to move anything that has a .XXX at the end. I want to move the files as listed in the active workbook and determine the number of files to move based on the info stored in column A. For i = 2 To Cells(Rows.Count, "A").End(xlUp).row Next i The directory location is stored in column B of my workbook. (Y:\abc\file.xxx) Can someone assist? Thanks, Barb Reinhardt |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Move all files from one directory to another | Excel Programming | |||
move all files in a directory into another | Excel Programming | |||
Move files from one directory to another: if they are there | Excel Programming | |||
macro to move contents of directory | Excel Programming | |||
run macro for all files in the directory | Excel Programming |