The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    Excel: Custom Template Save/Use?

    Discussion in 'Windows OS and Software' started by X2P, May 9, 2009.

  1. X2P

    X2P COOLING | NBR Super Mod

    Reputations:
    3,179
    Messages:
    5,361
    Likes Received:
    4
    Trophy Points:
    206
    Well I have started using excel to create graphs but I am running into an annoying issue.

    I want to use the exact same settings for every graph as well as make sure its the exact same size.

    I attempted to google this but kept coming back with templates.

    Cheers
     
  2. kevin071586

    kevin071586 Notebook Consultant

    Reputations:
    26
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    30
    Excels user defined graph templates are notoriously horrible. In my experience, you have two options:

    1) Create a custom template with the colors and line styles you want (about all the templates are good for) and set the size manually by Alt-Dragging the edges to cells. By holding Alt, the graph will snap to the cells and you can make several graphs the same size by making your cells very large.

    I.e. set the size of your excel cells very large manually so that you have one graph, per cell.

    2) Use macros. The Visual-Basic based macros in Excel are extremely easy to learn and very powerful to use for many applications. It should be relatively easy to make a macro so that you can just select a graph, then run the macro on that selected item to perform a set of tasks on it.


    Hope that helps,

    Kevin
     
  3. kevin071586

    kevin071586 Notebook Consultant

    Reputations:
    26
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    30
    I think I may have misunderstood your message.

    To create a User-Defined chart in Excel is a little bit odd. When you select the chart type, there is an option for "User-Defined'... but there is no Add button or any way to create your chart type.

    1. In Excel (Office XP, at least), you need to first create your chart using one of their default templates.

    2. Next, modify the charts colors and styles according to your preference.

    3. Right click on the chart, select " Chart Type..."

    4. Select the " Custom Types" tab at the top of the GUI that opens.

    5. Select the " User-defined" radio buttom.

    6. Click " Add..."

    The rest should be self explanatory!
     
  4. X2P

    X2P COOLING | NBR Super Mod

    Reputations:
    3,179
    Messages:
    5,361
    Likes Received:
    4
    Trophy Points:
    206
    Thank you kevin! How do I use it after I add it?
     
  5. kevin071586

    kevin071586 Notebook Consultant

    Reputations:
    26
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    30
    After you add it, the next time you create a chart you can select it from the "Custom Types" tab. It is in the same window where you would normally select Scatter Plot, Bar Graph, Pie Graph, etc.
     
  6. X2P

    X2P COOLING | NBR Super Mod

    Reputations:
    3,179
    Messages:
    5,361
    Likes Received:
    4
    Trophy Points:
    206
    Thanks Kevin :)

    Will this also let me have a set size (like 400X500 px)
     
  7. kevin071586

    kevin071586 Notebook Consultant

    Reputations:
    26
    Messages:
    101
    Likes Received:
    0
    Trophy Points:
    30
    No, to do that you'd need to use a Macro. I forget the exact syntax, but it is probably online somewhere.

    Or else, you could try the following:

    1) Select your graph (important to do this first)
    2) Start recording a macro
    3) Resize your graph vertically and horizontally (temporary sizes)
    4) Stop recording the macro
    5) Edit the macro
    (a) Find the lines that set the size
    (b) Change the values to what you need
    6) Save the macro

    -----

    Next, to use that macro you would just select the new chart that you created and run the macro.

    The code will be something like this:
    Code:
    Sub Macro1()
    '
    ' Macro1 Macro
    ' Macro recorded 5/9/2009 by Kevin
    '
    
    '
        ActiveSheet.Shapes("Chart 1").ScaleWidth 0.82, msoFalse, msoScaleFromTopLeft
        ActiveSheet.Shapes("Chart 1").ScaleHeight 0.84, msoFalse, _
            msoScaleFromBottomRight
    End Sub
    
    
    I don't know the lines exactly, but hopefully that is enough to get you headed in the right direction.

    EDIT: Apparently excel will explicitly reference the chart you select... i.e. where it says "Chart 1." Therefore, you would need to edit the macro every time you run it with the name of the specific chart that you are modifying. It is a huge pain in the , but I don't know any other way you can specifically do it without modifying the Code more to accommodate any selected graph.
     
  8. X2P

    X2P COOLING | NBR Super Mod

    Reputations:
    3,179
    Messages:
    5,361
    Likes Received:
    4
    Trophy Points:
    206
    Thanks kevin Ill give it a shot!