• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 902
  • Last Modified:

Cutting and pasting a text file using an Excel Macro

Hi Guys, I am trying to cut and paste a text file using an Excel Macro from one folder to another, but it does not record any code. Can anyone tell me what the VBA code is for this ?

  • 2
1 Solution
Name "c:\TMP\sample.txt" As "e:\Folder1\sample.txt"

Open in new window

JustincutAuthor Commented:
I don't understand your answer. I am trying to cut and paste a text file called "EOD_Rec" from "v:\EOD"  to "v:\REC" folder from a Macro within an Excel spreadsheet. There has to be "cut" and "paste" in the code
Cut and paste really means:
copy file, insert it to new folder, delete old file. In VBA you can do it with one command Name.
Place this code to your macro:
Name "v:\EOD\EOD_Rec.txt" As "v:\REC\EOD_Rec.txt"
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now