Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
ana ana is offline
external usenet poster
 
Posts: 3
Default How to move files from the code

Hi ,
does anyone know how to move all the file from one folder
to another from the code ?
For example : move *.* from C:\A to C:\B

thanks
ana
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default How to move files from the code

try
Sub movefile()
OldName = "C:\Al\yourfilename.xls"
NewName = "C:\B\yourfilename.xls"
Name OldName As NewName
End Sub
--
Don Guillett
SalesAid Software

"Ana" wrote in message
...
Hi ,
does anyone know how to move all the file from one folder
to another from the code ?
For example : move *.* from C:\A to C:\B

thanks
ana



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How to move files from the code

Hi Ana,

Try this routine posted by Dana deLouis:


Sub FilesMoveBetweenFolders()

Const FromFolder As String = "D:\Assets\*.*"
Const ToFolder As String = "D:\Closing\"

On Error Resume Next
With CreateObject("Scripting.FileSystemObject")
.CopyFile FromFolder, ToFolder, True
.DeleteFile FromFolder, True
End With

End Sub

---
Regards
Norman


"Ana" wrote in message
...
Hi ,
does anyone know how to move all the file from one folder
to another from the code ?
For example : move *.* from C:\A to C:\B

thanks
ana



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to move files from the code

Hi Ana,

Try this

name "C:\MyDir" as "C:\NewDir"

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Ana" wrote in message
...
Hi ,
does anyone know how to move all the file from one folder
to another from the code ?
For example : move *.* from C:\A to C:\B

thanks
ana



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
VBA Code - Find & Move Youlan Excel Discussion (Misc queries) 4 October 28th 08 07:26 PM
VBA Code - Find & Move Youlan Excel Discussion (Misc queries) 19 May 13th 08 11:42 PM
Pivot Table VBA code to move a row uclawarren Excel Discussion (Misc queries) 0 October 10th 05 08:49 PM
vba code to find ssn and move two columns rozb Excel Programming 2 April 10th 04 01:43 PM
code to move certain rows to another sheet Jay Baxter Excel Programming 3 February 27th 04 12:56 PM


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