Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub CopynReNameFiles()
FileCopy "D:\Max\DBrT.xls", "D:\Max\DBrT\Dxx1.xls" FileCopy "D:\Max\DBrT.xls", "D:\Max\DBrT\Dxx2.xls" FileCopy "D:\Max\DBrT.xls", "D:\Max\DBrT\Dxx3.xls" 'etc etc End Sub How could the above sub be amended to loop through & read-in/use all the destination file names, ie: Dxx1 Dxx2 Dxx3 etc, etc from the list of 100+ names that's already placed in col A in the active sheet? Thanks for insights |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub CopynReNameFiles()
Dim LastRow As Long Dim i As Long With ACtiveSheet LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row For i = 1 To LastRow FileCopy "D:\Max\DBrT.xls", "D:\Max\DBrT\" & .Cells(iI, "A").Value & ".xls" Next i End With End Sub -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Max" wrote in message ... Sub CopynReNameFiles() FileCopy "D:\Max\DBrT.xls", "D:\Max\DBrT\Dxx1.xls" FileCopy "D:\Max\DBrT.xls", "D:\Max\DBrT\Dxx2.xls" FileCopy "D:\Max\DBrT.xls", "D:\Max\DBrT\Dxx3.xls" 'etc etc End Sub How could the above sub be amended to loop through & read-in/use all the destination file names, ie: Dxx1 Dxx2 Dxx3 etc, etc from the list of 100+ names that's already placed in col A in the active sheet? Thanks for insights |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, typo
Sub CopynReNameFiles() Dim LastRow As Long Dim i As Long With ACtiveSheet LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row For i = 1 To LastRow FileCopy "D:\Max\DBrT.xls", _ "D:\Max\DBrT\" & .Cells(i, "A").Value & ".xls" Next i End With End Sub -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Bob Phillips" wrote in message ... Sub CopynReNameFiles() Dim LastRow As Long Dim i As Long With ACtiveSheet LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row For i = 1 To LastRow FileCopy "D:\Max\DBrT.xls", "D:\Max\DBrT\" & .Cells(iI, "A").Value & ".xls" Next i End With End Sub -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Max" wrote in message ... Sub CopynReNameFiles() FileCopy "D:\Max\DBrT.xls", "D:\Max\DBrT\Dxx1.xls" FileCopy "D:\Max\DBrT.xls", "D:\Max\DBrT\Dxx2.xls" FileCopy "D:\Max\DBrT.xls", "D:\Max\DBrT\Dxx3.xls" 'etc etc End Sub How could the above sub be amended to loop through & read-in/use all the destination file names, ie: Dxx1 Dxx2 Dxx3 etc, etc from the list of 100+ names that's already placed in col A in the active sheet? Thanks for insights |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Many thanks, Bob.
That did it well. Max |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Won't Read Cell Names | Excel Discussion (Misc queries) | |||
amend formula | Excel Discussion (Misc queries) | |||
Amend SQL Query with VBA | Excel Programming | |||
How to amend formula ? | Excel Programming | |||
read a column of names and place a number in the next cell | Excel Discussion (Misc queries) |