Closed Thread
Results 1 to 2 of 2

Rename .txt Files VBA

  1. #1
    Registered User
    Join Date
    05-06-2014
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    3

    Exclamation Rename .txt Files VBA

    Hi all,

    I have a macro that should change the name for some .txt files that are created automatically. The issue I have is that the macro shows an error at the end from OldName to NewName

    My .txt files are generated automatically:

    Text_1.txt
    Text_2.txt
    Text_3.txt...
    ...
    Text_58.txt
    Text_59.txt

    Each file contains a code, for example


    Text_1.txt
    ----------------------------------------------------------------------------
    From: 09/12/14 My Report Summary
    To: 09/12/14
    Shift: 90 5p-8p

    Doc: 5015 Acer
    -----------------------------------------------------------------------------

    For every doc number select a case and rename it, but if the .txt file does not have any code the macro stops working.

    Could you please assist me on this? THIS IS URGENT!!!!

    below you can find the macro.

    Thanks.

    Willy

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 09-12-2014 at 11:47 PM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2403 Win 11 Home 64 Bit
    Posts
    23,811

    Re: Rename .txt Files VBA

    Welcome to the Forum, unfortunately:

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    Thread Closed.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Rename files with same name
    By Smally in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-04-2014, 07:45 AM
  2. How to copy and rename files in vba by searching multiple folders for files
    By razorace in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-04-2014, 04:21 AM
  3. [SOLVED] VBA to rename files?
    By jeff p in forum Excel General
    Replies: 2
    Last Post: 04-15-2012, 11:39 PM
  4. Rename Files from VBA
    By TonyforVBA in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-23-2010, 08:01 AM
  5. Rename files with VBA
    By michelle439731 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-11-2009, 12:00 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1