+ Reply to Thread
Results 1 to 9 of 9

Renaming a sheet and file name

  1. #1
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Renaming a sheet and file name

    Hi,

    I have two macros that do the same task but i need to amend them both slightly and I require some help please...

    In the code:
    Please Login or Register  to view this content.
    The newly created files have an additional space which I need to remove. e.g. "1010220-TrialBalance-062018 .XLS" how do I remove this?

    In both codes (Splitter and Preparefiles) new sheets are created called "Sheet1". Is there any way I can change this to "Trial Balance"? I havent included the 2nd code but its within the workbook.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Renaming a sheet and file name

    Please Login or Register  to view this content.
    Please do add reputation where you see fit, it's nice to be nice and we all enjoy a pat on the back

    Please also mark your thread as solved once it has been.

  3. #3
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Renaming a sheet and file name

    Thank you - that saves the first issue

    The 2nd requirement is in both macros changing the "Sheet1" to "Trial Balance" can anyone help with that please?

    Code 1

    Please Login or Register  to view this content.
    Code 2:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    08-06-2012
    Location
    Shipley, UK
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: Renaming a sheet and file name

    Removes the space and renames the sheets to "Trial Balance"

    Please Login or Register  to view this content.

    Please Login or Register  to view this content.
    Last edited by Tayque_J_Holmes; 07-05-2018 at 04:26 AM.

  5. #5
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Renaming a sheet and file name

    Hi,

    The macro worked for the macro preparefiles (it renamed the "sheet1" to "Trial Balance"). Thank you!

    For Splitter though it doesn't actually save the file - instead it just leaves them open on the screen. I am now required to click ok each time a new file is created. Is there anyway to disable this as I didnt do it previously.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    08-06-2012
    Location
    Shipley, UK
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: Renaming a sheet and file name

    Hi,

    Apologies, I disabled it as I didn't want files saving to my desktop, change

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Renaming a sheet and file name

    Hi,

    I have changed that but I still have to click "ok" each time - any way to prevent this?

  8. #8
    Registered User
    Join Date
    08-06-2012
    Location
    Shipley, UK
    MS-Off Ver
    Excel 2010
    Posts
    69

    Re: Renaming a sheet and file name

    Hi,

    remove the following line;
    Please Login or Register  to view this content.

  9. #9
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: Renaming a sheet and file name

    Thank you!!!

+ 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. Printing single sheet to .pdf then embedding the file. (renaming OLEObject?)
    By Canuckle777 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-14-2013, 12:56 PM
  2. [SOLVED] Renaming File Name
    By wfm007 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-21-2013, 12:52 PM
  3. Renaming the file name (or part of the file name) from a list
    By bbottjen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-02-2012, 08:30 PM
  4. Writing a file’s name (or renaming it ) based on existing excel sheet data
    By subbby in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-30-2012, 08:11 PM
  5. Replies: 15
    Last Post: 08-27-2012, 10:13 AM
  6. Replies: 4
    Last Post: 03-09-2011, 05:25 PM
  7. Renaming a file
    By boylejob in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-27-2007, 07:47 PM
  8. [SOLVED] Renaming File
    By Arjun Dutta in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-26-2006, 12:50 PM

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