+ Reply to Thread
Results 1 to 4 of 4

Can a macro rename Excel files based on a cell's contents?

  1. #1
    Registered User
    Join Date
    06-23-2014
    Location
    usa
    MS-Off Ver
    2007
    Posts
    8

    Can a macro rename Excel files based on a cell's contents?

    Can a macro rename Excel files based on a cell's contents? The problem maybe that I download these files en masse from a website and they all have 54-character long randomly generated filenames which I can rename by selecting all and then use the rename function to get a series of filenames like a, a(2), a(3), ... but I would rather have the files renamed based on the text that exists in cell B1 which is the title of the report. I also read somewhere that this kind of macro only works if the tabs have names like "Sheet 1"

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Can a macro rename Excel files based on a cell's contents?

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,601

    Re: Can a macro rename Excel files based on a cell's contents?

    Please Login or Register  to view this content.
    Ben Van Johnson

  4. #4
    Registered User
    Join Date
    06-23-2014
    Location
    usa
    MS-Off Ver
    2007
    Posts
    8

    Re: Can a macro rename Excel files based on a cell's contents?

    I got my answer from a Redditor named johndoe555
    at this link but now I thought of some more tweeks.

    Can you add some more code to do the following?
    • (1) Generate a prompt to enter 9 more characters to put both right before .xls and in cell A1
    • (2) Copy the font formatting from cell B1 to cell A1
    • (3) Put the date and time in cell W1 that is found in cell B2. The text in cell B2 always has the following format "Requested 393926326osel5105 (US) on 06/26/2014, 13:58"

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel Macro to save several text files, based on the contents of two cells.
    By chronologie2 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-29-2012, 11:31 AM
  2. Rename cell based on file name for multiple files
    By lmolokin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2012, 05:49 PM
  3. Rename Excel files based on cell contents
    By remco_t in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-28-2012, 06:10 PM
  4. Rename files with excel macro.
    By abhay_547 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-06-2010, 11:49 AM
  5. Rename files based on excel worksheet list
    By badgeradrian in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2009, 05:52 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