I have done a macro in Excel xp that updates some excel files with new text files coming in. I want to move the text files to a folder called “old” after the macro is done. Can someone help me with some vba code in excel to do this. Thanks a lot.
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Move files with vba within Excel (xp, win2000)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Move files with vba within Excel (xp, win2000)
- This topic has 2 replies, 3 voices, and was last updated 23 years, 3 months ago.
Viewing 1 reply threadAuthorReplies-
H. Legare Coleman
AskWoody Plus -
WSDWright
AskWoody PlusJanuary 29, 2002 at 7:08 pm #566957The command you are looking for is the Name statement.
Name oldpathname as newpathname
From the VBA help:
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
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Add serial device in Windows 11
by
Theodore Dawson
7 minutes ago -
Windows 11 users reportedly losing data due forced BitLocker encryption
by
Alex5723
1 hour, 6 minutes ago -
Cached credentials is not a new bug
by
Susan Bradley
4 hours, 41 minutes ago -
Win11 24H4 Slow!
by
Bob Bible
4 hours, 52 minutes ago -
Microsoft hiking XBox prices starting today due to Trump’s tariffs
by
Alex5723
2 hours, 3 minutes ago -
Asus adds “movement sensor” to their Graphics cards
by
n0ads
7 hours, 2 minutes ago -
‘Minority Report’ coming to NYC
by
Alex5723
3 hours, 11 minutes ago -
Apple notifies new victims of spyware attacks across the world
by
Alex5723
15 hours, 44 minutes ago -
Tracking content block list GONE in Firefox 138
by
Bob99
15 hours, 8 minutes ago -
How do I migrate Password Managers
by
Rush2112
57 minutes ago -
Orb : how fast is my Internet connection
by
Alex5723
46 minutes ago -
Solid color background slows Windows 7 login
by
Alex5723
1 day, 3 hours ago -
Windows 11, version 24H2 might not download via Windows Server Updates Services
by
Alex5723
1 day, 1 hour ago -
Security fixes for Firefox
by
Susan Bradley
2 hours, 22 minutes ago -
Notice on termination of services of LG Mobile Phone Software Updates
by
Alex5723
1 day, 14 hours ago -
Update your Apple Devices Wormable Zero-Click Remote Code Execution in AirPlay..
by
Alex5723
1 day, 23 hours ago -
Amazon denies it had plans to be clear about consumer tariff costs
by
Alex5723
1 day, 14 hours ago -
Return of the brain dead FF sidebar
by
EricB
1 day, 1 hour ago -
Windows Settings Managed by your Organization
by
WSDavidO61
4 hours, 25 minutes ago -
Securing Laptop for Trustee Administrattor
by
PeachesP
51 minutes ago -
The local account tax
by
Susan Bradley
1 day, 2 hours ago -
Recall is back with KB5055627(OS Build 26100.3915) Preview
by
Alex5723
2 days, 12 hours ago -
Digital TV Antenna Recommendation
by
Win7and10
2 days, 4 hours ago -
Server 2019 Domain Controllers broken by updates
by
MP Support
3 days ago -
Google won’t remove 3rd party cookies in Chrome as promised
by
Alex5723
3 days, 1 hour ago -
Microsoft Manager Says macOS Is Better Than Windows 11
by
Alex5723
3 days, 4 hours ago -
Outlook (NEW) Getting really Pushy
by
RetiredGeek
2 days, 7 hours ago -
Steps to take before updating to 24H2
by
Susan Bradley
5 hours, 18 minutes ago -
Which Web browser is the most secure for 2025?
by
B. Livingston
2 days, 11 hours ago -
Replacing Skype
by
Peter Deegan
2 days ago
Recent blog posts
Key Links
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.