Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Naz Naz is offline
external usenet poster
 
Posts: 85
Default Moving files

Hello

Every month i get a output from our system of about 3000 excel files into a
folder say c:\output\ the files are number numberically 1.xls 2.xls 3.xls
But out of these files i only need about 30, i have a list of these files,
and i need to copy them from their current destination to c:\users\bg56\
Is is possible to create a macro, where is i can populate a column say
A1:A50 with the file numbers i need 1 2 50 75 55 and have the macro move
those files ?

I know basic vba but not how to move files, so all help is greatly
appreciated.


Thanks
--

_______________________
Naz,
London
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default Moving files

Naz,

Ron DeBruin has a great VBA tutorial on this:
http://www.rondebruin.nl/folder.htm#Copy

--
--Thomas [PBD]
Working hard to make working easy.
Answered your question? Click ''Yes'' below.


"Naz" wrote:

Hello

Every month i get a output from our system of about 3000 excel files into a
folder say c:\output\ the files are number numberically 1.xls 2.xls 3.xls
But out of these files i only need about 30, i have a list of these files,
and i need to copy them from their current destination to c:\users\bg56\
Is is possible to create a macro, where is i can populate a column say
A1:A50 with the file numbers i need 1 2 50 75 55 and have the macro move
those files ?

I know basic vba but not how to move files, so all help is greatly
appreciated.


Thanks
--

_______________________
Naz,
London

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Moving files

You will be surprised to see that it's easier than you would think. All you
do is rename. Here is the basic idea. Modify to suit your files.

Sub movefile()
startit:
OldName = "C:\personal\1065.xls"
newname = "C:\a\1065.xls"
On Error GoTo killit
Name OldName As newname
killit:
ans = InputBox("do you", vbOKCancel)
If ans = Cancel Then Exit Sub
If ans = OK Then
MsgBox newname
'Kill newname
End If
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Naz" wrote in message
...
Hello

Every month i get a output from our system of about 3000 excel files into
a
folder say c:\output\ the files are number numberically 1.xls 2.xls
3.xls
But out of these files i only need about 30, i have a list of these files,
and i need to copy them from their current destination to c:\users\bg56\
Is is possible to create a macro, where is i can populate a column say
A1:A50 with the file numbers i need 1 2 50 75 55 and have the macro
move
those files ?

I know basic vba but not how to move files, so all help is greatly
appreciated.


Thanks
--

_______________________
Naz,
London


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
moving files Donna S Excel Programming 3 May 30th 07 10:15 PM
Moving files which are linked chrismc1972 Excel Discussion (Misc queries) 1 January 23rd 07 09:28 PM
Moving files JT Excel Programming 1 August 10th 06 04:02 PM
macro as and moving files dr chuck Excel Programming 1 June 30th 06 01:33 AM
Moving Files PraxisPete Excel Programming 3 December 1st 05 10:07 AM


All times are GMT +1. The time now is 11:59 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"