+ Reply to Thread
Results 1 to 4 of 4

Thread: Rename worksheets in Excel file exported from Access

  1. #1
    Barn Loyal Rebelle will become famous soon enough Rebelle's Avatar
    Join Date
    Mar 2008
    Posts
    868
    Rep Power
    3

    Rename worksheets in Excel file exported from Access

    Hi All,

    I've created a simple macro that contains "Transfer Spreadsheet" to directory:
    c:\myfiles\NewFile.xls

    I'm using export to export 5 different queries into the new file, this all works fine but example the first query name is qryGrandTotalsForYear then this comes across in excel on the tab name. Is there a way I can give it a name prior or during the export?

    I would want qryGrandTotalsForYear to be Yearly Grand Totals.

    Thanks in advance for any suggestions here.

  2. #2
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    1,736
    Blog Entries
    10
    Rep Power
    11

    Is this a macro inside a spreadsheet?

    Something like
    Code:
    ActiveWorkbook.Sheets(0).Name="Your Name"
    
    would work using an index value (ie index of 0)
    or
    Code:
    ActiveWorkbook.Sheets("Sheet Name").Name="Your Name"
    
    if using the sheet name.

    Hope that helps.

  3. #3
    Barn Loyal Rebelle will become famous soon enough Rebelle's Avatar
    Join Date
    Mar 2008
    Posts
    868
    Rep Power
    3

    Hi RR,

    This is a macro in access that uses "Transfer Spreadsheet" feature to take query results and put them into an excel file.

    Once it's in excel it automatically puts the access query name on the tab/worksheet...this is what I would like to know if I am able to change when its putting into excel.

  4. #4
    Barnie alansidman is on a distinguished road alansidman's Avatar
    Join Date
    Apr 2008
    Location
    Lake County, IL
    Posts
    20
    Rep Power
    3

    Is this helpful. Look at the attached.
    Attached Files

+ Reply to Thread

Similar Threads

  1. import excel file into asp_net membership
    By peebman2000 in forum .Net Development
    Replies: 11
    Last Post: May 25th, 2010, 09:18 AM
  2. Export to Excel file prompt
    By Rebelle in forum ASP Development
    Replies: 2
    Last Post: August 14th, 2009, 01:20 PM
  3. Multiple Copy and Rename of File...
    By grae.uk in forum Windows Scripting
    Replies: 11
    Last Post: April 30th, 2009, 07:44 PM
  4. Tip for Reports Exported to Excel
    By Lauramc in forum SQL Server Reporting Services Help
    Replies: 0
    Last Post: January 13th, 2009, 10:09 PM
  5. opening excel file
    By todd2006 in forum ASP Development
    Replies: 5
    Last Post: April 30th, 2008, 05:36 AM

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

SEO by vBSEO