+ Reply to Thread
Results 1 to 3 of 3

Macro sheet naming and referencing

Hybrid View

  1. #1
    Registered User
    Join Date
    09-07-2007
    Posts
    14

    Macro sheet naming and referencing

    Hi guys,
    new enough to macro's. having trouble writing a macro for copying a sheet.
    Data is entered into the data sheet and each month a new sheet with graph is produced by the macro with the option of naming it.

    I can't figure out how to have the source data for each new sheet/chart reference the data in the data sheet without the previous charts source data changing as a result. I essentially need to create a new chart with frozen data and be able to name the sheet. Any suggestions greatly appreciated.

  2. #2
    Forum Expert
    Join Date
    11-23-2005
    Location
    Rome
    MS-Off Ver
    Ms Office 2016
    Posts
    1,628
    Try with this macro:
        Sheets("Graph1").Copy After:=Sheets(Sheets.Count)
        ActiveSheet.Name = "Graph1 new"
    where "Graph1" is the name of the window with your graph to copy.

    I hope it's what you need.

    Regards,
    Antonio

  3. #3
    Registered User
    Join Date
    09-07-2007
    Posts
    14
    Quote Originally Posted by antoka05
    Try with this macro:
        Sheets("Graph1").Copy After:=Sheets(Sheets.Count)
        ActiveSheet.Name = "Graph1 new"
    where "Graph1" is the name of the window with your graph to copy.

    I hope it's what you need.

    Regards,
    Antonio
    Hey antoka thanks for the help however it doesn't seem to be working for me. When I used the above it just copied over my data sheet page and renamed it as graph1 new.#
    I have a data sheet and a graph sheet. Each time I use the macro I want to make a new graph sheet using the information from the data sheet so at the end of the year there are 12 graphs, however the information in each graph most be frozen to the data at the time it was created and not continually reference the changing data on the data sheet.
    It might be a bit confusing.
    Thanks again

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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