Excel Tips
Excel Tips
Jon Paul
Progressive System Solutions, Inc.
847-295-7179
[email protected]
(Note- this was produced in 1997 for
the 97 version of Excel)
How Cold Was It?
So cold I know someone who slept with 16
sheets on their bed!
Just Open 1 Sheet!
• Select Tools from Menu Bar
• Select Options
• Select General
• Sheets in new workbook- change to 1
Moving Between Worksheets
• Find arrow buttons in lower left hand side of
screen
• Right mouse click on far right arrow button
• You now get list of sheets
• If large number of sheets, select more sheets
on the bottom
• Scroll down to find the sheet you want
• Click OK- away you go!
Moving or Copying a Worksheet
• Right mouse click on worksheet name
• Select move or copy
• Choose a workbook you want to send it to
– selects current workbook by default
• Select where in the workbook you want it
• Check Create a copy if you want to copy it
– Otherwise you could be moving and not be
expecting it!
Inserting or Deleting a
Worksheet
• Right mouse click on any worksheet name in
your workbook
• Select Insert
• Double click on Worksheet to add a blank
worksheet to your workbook
• Can use same technique to add chart
• Deleting- follow same steps only select Delete
rather than Insert- be careful!
Driving With Half a Windshield
• Give yourself a full view of your worksheet
• One way to show the whole width- find
Zoom box- on toolbar and shrink percentage
• Even better way-
– highlight every column in your worksheet
– go to Zoom box on toolbar
– choose Selection
– will automatically resize worksheet for you
• Just changes size of view, not column size
Your Car Has More Than One
Window- So Can Your Worksheet
• Window menu- select New Window
• Gives you a second view of your current
workbook
• Second window is not sized
• If going back to one window, make sure
you are closing out the second
• Windows will be identified by :1 or :2
Do You Leave Your Doors
Unlocked?
No
And
2.3 kids
Get A ‘Round’ to This
• Round functions for more meaningful
numbers
– 2 or 3 kids, not 2.3 kids
• Changes to whole number so next
calculation also makes sense
– at 10,000 per kid, cost is 20,000 or 30,000
• Round, Roundup or Rounddown
Round to Your Size
• Round- rounds up (5-9) or down (0-4),
depending on the digits being rounded
• Roundup- rounds up, away from zero
• Rounddown- rounds down, closer to zero
• How to do:
– = Round(calculation, decimal places)
– decimal places can be negative number
– substitute Roundup or Rounddown if wanted
How Do You Eat at a Buffet?
Do You Take Everything They Offer You?
• Sales - Costs
How to Add Names- Name Box
• Using the Name box- left of Formula bar
– highlight the cell or range you want to name
– click in the box and enter the name (no spaces)
– hit enter (otherwise name does not get saved)
Adding Names- With Menu Bar
• Using the Menu- individually define
– highlight the cell or range you want to name
– in Insert menu, select Names
– select Define Names
– give it a name and click OK
• Using the Menu- group define
– highlight the range you want to name
– in Insert menu, select Names and Create Names
– select rows and/or columns and click OK
Use Names to Add Constants
• Example: WeekendFee = 9.95
• Suppose you have a value you will use over and
over again in a workbook
• Use names to set up that constant
• Makes sure you always use the same value
• If needs to be changed, can do all at once
• To set up constant, have to use Names menu
Referring to Names in Formulas
• Go to cell and hit = or + to start formula
• From Insert menu, choose Names and Paste
• Select the Name and click OK
• Can also select name by going to Name Box
• Click on down arrow to pull up Name list
• Select the Name and Enter
• A third way- type in Name manually
Multiple Names in Formulas
• You can have multiple names in formulas
• To put in additional name:
– Put in first name
– Add the next part of your formula
– Put in second name
– Continue as needed
Show List of Names
• You can paste a list of all names to a sheet
• Insert new worksheet and call it Names
• From Insert menu choose Names and Paste
• From dialog box select Paste List
• Expand size of column as needed
• Note- new Names not automatically added
– Do paste link again as needed
Let’s Link Up
• Paste Special- Paste Link Option
• Use when you want to have an automatic
link to the original cell
• Only works with pasting all or pasting all
except borders
• Great for starting at source and copying to
the destination
More Than One Way to Link
• Can also link starting from the destination
cell:
– Click on the destination cell
– Enter “+” or “=“
– Go to the source of the information
– Hit enter to complete the link
Can You Name Another Link
• Have you set up Names?
• If so, you have an even better way to link
• Get on the destination cell
• Go to the Insert menu and select Names
• Choose Paste option and select the Name
• You now have a link to a Name range
• Link needs to be in same relative position
Is Your Fence In Good Shape?-
Check Your Links
• In Edit menu, select Links
– If Links is greyed out, you have no links
• Can change source to different workbook
• Open source if you want to check it out
• If Update Source highlighted, may need to click
on Update Now to update
• If source already open, should automatically
update
Sherlock Holmes Wishes He Was
Around For This
• Solver- find the answer you are looking for
• Get the right answer right away, rather than
having to keep guessing until you get it
• Solve complex what-ifs very quickly
• Solver is an add-in- to install:
– In Tools menu, select Add-ins
– In Add-in dialog, click on Solver and then OK
Solver Steps
• In Tools menu, select Solver
– if Solver is not a choice, you need to add it in
• Target cell- where your target to solve is
• Equal to- specify value (or min or max)
• By changing cells- cells you want to change
to get target to desired value
• Can add constraints but not needed
• Click on Solve to let it run
Solver Result
• If Solver finds results, you get Solver
Results dialog box
– Get choice to keep choice or restore original
• Can also save choice as a scenario
• If there is not a logical choice, Solver will
come back and say it could not find one
– In that case, restore original solution
Can’t Make Up Your Mind-
Then Don’t
With Scenario Manager
Take it!
Headers- Optional
Formula Cell Input Cell 2 Values
Go 3D and Beyond
Get Your Data Ready
• Needs to be in a database format
• Titles in the first row
• Data in the other rows
• Can use data imported from other files
Transfering Data to a Pivot Table
• From Data menu, select Pivot Table
• The Pivot Table Wizard appears
• Choose your source- usually Excel database
• Select the database range- include titles
• Next drag field buttons to where you want
that data in the pivot table (more on this)
• Finish- create pivot table name
Pivot Table Field Buttons Options
• Page- show data one “page” at at time on
the screen- such as one MTA, then another
• Rows and Columns- just as you think it is
• Data- the data in the middle
– remember, best if it is data (this is easy to
forget)
Explore Pivot Table Power!
• Move your field buttons around- like
looking in a cube from a different angle
– in and out of page view
– from rows to columns
– different order of fields
Here’s What One Looks Like
Date (All)
• Sub Print_Solver()
• Sheets("Solver").Select
• ActiveWindow.SelectedSheets.PrintOut Copies:=1
• End Sub
Make More Print Macros
• Go to the sheet where the print macro is
located (name it Print Macros)
• Highlight and copy Print_Solver
• Go below Print_Solver and paste
• Highlight the new macro
• Change Solver in new macro to Scenarios
• You now have your second print macro!
As Jay Leno Said- We’ll Make
More- Here’s a Faster Way
• Code a macro directly- here’s how
• Go below Print_Scenarios
• Enter two spaces
• Start with ‘ (apostrophe) for comment
• Finish the comment line
– ‘ Print_Sumif Macro
• Enter another space- see next chart
Set Up Your Coding
• Now you are ready for the code
• Enter Sub and Macro name in first code line
– Sub Print_Sumif
• Hit enter to finish this line
• Hit enter again for a blank line
• Next enter End Sub
• Now we will go and enter the body
Finish Your Coding
• Go back to the blank space inbetween the Sub
and End Sub line- this is where we will put
the code
• Indent and then enter:
– Sheets(“Sumif”).Select
• Enter to finish that line; on next line enter:
– ActiveWindow.SelectedSheets.PrintOut Copies:=1
• That’s it- you finished!
Test Your Print Macro
• You can test your macro while still in the
Print Macro sheet
• Keep your cursor in the body of the
Print_Sumif macro
• Then click on the green arrow in the toolbar
above
• Your macro is running!
Summary- Macro Parts
• Introductory Comments
• Sub- starts the macro
• Body of the macro
• End Sub- ends the macro
Tying the Macros Together
• Macros can also run other macros
• First, manually set up another macro
• Name this macro Print_All
• In the body add names of other print macros
– Print_Solver
– Print_Scenarios
– Print_Sumif
• This macro will run all 3 at the same time
That’s Fine But I Don’t Like the Page
• One of the most cumbersome things in
Excel can be setting up pages
• Updating page setups isn’t much more fun
• Macros to the rescue here too!
Setup the Print Setup Macro
• Select a sheet you want to setup
• Set up recording a macro like before
– Tools menu, Record Macro
– Select Record New Macro
– Give macro a name- call it Print_Setup
– Click OK to start recording the macro
Record the Print Setup Macro
• You are now recording the macro
• Go to the File menu- select Print Setup
• Make the print setup choices you want
• Click on OK to close print setup
• Click black recorder button to stop
recording macro
Using the Print Setup Macro
• If settings you want are already same as the
macro, just go ahead and run the macro
• If not, go to Macro sheet with Print_Setup
• Edit any setups you want to do differently
on another sheet
• Go to the sheet where you want to change
the print setup
• Run the macro
You Wouldn’t Dress Without
Buttons
• Use buttons for quick access to your macros
• Ways to use:
– For different print versions of the same sheet
– On a print index worksheet to choose which
sheets to print
Using Buttons
• Locate a sheet for the buttons (Print Index)
• Right click in toolbar area and select Forms
• Click the Button button (sorry, had to say it)
• Go to the spot where you want the button
• Click and draw the button in
• You can assign a macro; click OK to finish
• Right click on the button to rename it
• Add label next to button if you like
Adding More Buttons
• Repeat previous steps or
• Copy current button
– right mouse click and select copy
• Paste the button to the new spot
• Rename the new button
• Right mouse click new button and choose Assign
Macro
• Assign macro that belongs to new button
Waiter- It’s Not on the Menu
• Another option to buttons
• Put it on the menu
• In Tools, select Macro
• Click on the macro and then Options
• Check the box, Assign to Menu Item
• Add a name for the menu bar (spaces okay)
• Click OK
• It’s now on the bottom of the Tools menu
Closing Ideas
• Use Those Names!
• Keep Values in Separate Cells-
– don’t bury them in formulas
• Build Formulas in Pieces
• Split Your Work Into Separate Sheets or
Workbooks
– don’t overload a sheet or workbook
• Keep Learning and Experiment
Congratulations
You’re Ready to Excel!
Jon Paul
Progressive System Solutions, Inc.
847-295-7179
[email protected]