Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default Moving files between folders using VBA in Excel

Hi,
It would be to easy for them to call it move
Regards
JY
From help

Name Statement


Renames a disk file, directory, or folder.

Syntax

Name oldpathname As newpathname

The Name statement syntax has these parts:

Part Description
oldpathname Required. String expression that specifies the existing
file name and location - may include directory or folder, and drive.
newpathname Required. String expression that specifies the new file
name and location - may include directory or folder, and drive. The file
name specified by newpathname can't already exist.



Remarks

The Name statement renames a file and moves it to a different directory or
folder, if necessary. Name can move a file across drives, but it can only
rename an existing directory or folder when both newpathname and oldpathname
are located on the same drive. Name cannot create a new file, directory, or
folder.

Using Name on an open file produces an error. You must close an open file
before renaming it. Name arguments cannot include multiple-character (*) and
single-character (?) wildcards.





"Paul" wrote in message
...
C:\HOLD has 2 files in it: FILE1.csv, FILE2.csv.
I need to move the files from C:\HOLD to C:\WORK.

The Excel Help information did not include examples of how Move and
Movefile are actually put into practical code, and I've given up tearing

my
hair out, trying to make it work.

Could somebody please show me the code.

TIA
Paul



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
How to open same name files in different folders in Excel? DrDisk7 Excel Discussion (Misc queries) 1 April 1st 08 02:35 PM
change display format for excel folders and files inthestands Excel Worksheet Functions 4 May 15th 06 01:07 PM
Open Excel files/folders animalfriend7 Excel Discussion (Misc queries) 1 June 23rd 05 11:57 PM
Excel VBA: moving folders on the server Myrna Rodriguez[_2_] Excel Programming 2 May 17th 05 01:47 AM
moving folders Gary[_11_] Excel Programming 4 December 16th 03 07:29 PM


All times are GMT +1. The time now is 07:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"