50 Essential Excel Tips
50 Essential Excel Tips
50 Essential Excel Tips
Table of contents
Easy data-posting to the Web ........................................................................ 3
Open Web pages right in Excel ...................................................................... 3
Detect And Repair.......................................................................................... 3
User-level prevention is a magic cure ............................................................ 4
Opening multiple windows ............................................................................. 4
Creating custom lists ...................................................................................... 4
Copying styles between workbooks ............................................................... 5
A macro that pulls source data from charts .................................................... 5
Update for Excel 2000 text export .................................................................. 5
Creating a workspace in Excel ....................................................................... 5
Printing formulas ............................................................................................ 6
Shifting a scatter chart's axis .......................................................................... 6
Recovering data with the SYLK format ........................................................... 6
Faster access to worksheets .......................................................................... 7
Inserting the full file path in headers and footers ............................................ 7
Exceeding the 30-argument limit .................................................................... 7
Ask Mr. Excel ................................................................................................. 7
Catching data entry errors .............................................................................. 7
Quickly setting a print area ............................................................................. 8
Counting the days via cell subtraction ............................................................ 8
Quickly shuffling toolbar buttons .................................................................... 8
Opening a workbook at startup ...................................................................... 8
Hiding duplicate records................................................................................. 8
Converting Julian dates.................................................................................. 9
Saving time with Custom Views ..................................................................... 9
Beware of sharing dates between Excel for Windows and Excel for Macs ..... 9
Don't use AutoFormat on an entire worksheet.............................................. 10
50 Essential Microsoft Excel tips
Inserting the resulting HTML tables into an existing HTML page or creating an entirely new page.
Specifying formatting options, such as rules between data.
Saving the new HTML page as a freestanding file or inserting it directly into a FrontPage Web.
Open Web pages right in Excel
If your users need to analyze data found on a Web site, they might be in for a bunch of tedious retyping.
Under the right circumstances, however, Excel 97 can save them a lot of time by letting them open an
HTML page in Excel directly from the Web.
Printing formulas
If your users have invested time in writing numerous formulas, they may want to print them for
safekeeping. Although Excel doesn't include a simple "Print Formulas" button, functionality is built in.
Here's how to find it:
1. Go to the Tools menu.
2. Click Options.
3. Within the section called Window Options on the View tab, select Formulas.
4. Click OK.
There is also a keyboard shortcut for this function. Press [Ctrl]~. In both cases, the result is that the
formulas, rather than their results, will appear in the worksheet.
Beware of sharing dates between Excel for Windows and Excel for Macs
Excel supports two data systems: 1900 and 1904. Early Macintoshes did not support dates before Jan. 1,
1904. For this reason, Excel for Macs renders entered dates as the number of days since 1/1/1904. Excel
for Windows, on the other hand, supports dates starting Jan. 1, 1900, and so renders dates as the
number of days since 1/1/1900.
For example, the date 1/1/1904 is represented as a 0 in the 1904 date system. The same date in the
1900 date system is represented by the number 1,462. This is because 1/1/1904 is 1,462 days since
1/1/1900, the day the 1900 date system begins its "counting."
What all this means to you is that if you have users on both Macs and PCs using Excel and copying
data between workbooks, there's the chance of incorrect date representation.
One solution is to set your PCs so that they all use the 1904 date system. Then they'll be compatible
with the Macs. To do so, open a workbook and select Tools | Options. Click the Calculation tab. Under
Workbook Option, select the 1904 Date System check box and click OK. For more information, check out
Microsoft's Knowledge Base article 214330, which covers this issue in depth:
http://support.microsoft.com/support/kb/articles/Q214/3/30.asp
50 Essential Microsoft Excel tips
Conditional formatting
Conditional formatting is one of Excel's better features. It allows you to preset certain font styles, colors,
and cell-background colors based on cell values. This can be very useful for highlighting important
information and values outside an accepted range or providing a visual cue to associate value ranges
with color codes.
The best part is that conditional formatting is easy to set up. Just click the cells you'd like to format and
select Format | Conditional Formatting. The Conditional Formatting dialog box lets you set up the
conditions by which the formatting of the cell will occur. You pick the operator (between, equal to, less
than, etc.) and the value or range of values. Click Format to open the Format Cells dialog box, where you
can select the colors and styles to be used.
Each cell can have several conditional formats. For example, you might say that if a certain cell's value
is between 20 and 50, the text should be blue on a yellow background. But you can format that same cell
to exhibit red, bolded text on a green background if it contains a value between 51 and 100.
50 Essential Microsoft Excel tips
The IF function evaluates the first parameter (DIVISOR = 0). If it's TRUE, it places the second
parameter ("Your Text") in the cell. If it's FALSE, the function places the third parameter
(DIVIDED/DIVISOR) in the cell.
This helps you control the message that's displayed when your formula produces a zero value that is
then used to divide another value.
will open your file called Hyperlinktesting.xls and then select cell A1 on Sheet1.
Using this kind of linking, you can specify exactly where your user will enter the workbook. Users' views
of the workbook won't be bound by the state at the last save.
This can be helpful if you insert the link to a Web page that asks the user to enter data in a particular
cell or area of a sheet. You can select the cell for them when they click the link.
For information on linking to Excel 97 worksheets, see Microsoft Knowledge Base article 172503:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;172503
For details on linking to Excel 2000 worksheets, see Microsoft Knowledge Base article 211693:
http://support.microsoft.com/support/kb/articles/q211/6/93.asp
50 Essential Microsoft Excel tips
the values of certain cells match criteria you set—all without any user interaction. This sample macro will
get you started in the right direction:
Sub CreateOutlookMail()
Dim olApp As Outlook.Application
Dim olMailMessage As Outlook.MailItem
.Display
End With
Set olMailMessage = Nothing
olApp.Quit
Set olApp = Nothing
End Sub
You can use the Immediate window to check or change variable values or object properties to test the
results on your running code. You can also call other procedures from this window. For example:
Debug.Print A * 125
multiplies the current value of the variable A by 125 and prints the results in the window.
Activesheet.Name = "New Name"
changes the name of the active sheet.
The Immediate window offers an excellent way to test the outcome of new values or property changes
on your code without inserting the new code into your procedure.