You are on page 1of 8

How To Use Microsoft Excel To Manage Your Life

Written by Ryan Dube


September 19, 2012

(http://www.makeuseof.com/tag/author/ryandube/)

Its no secret that Im a total Excel fanboy. Much of that comes from the fact that I enjoy
writing VBA code, and Excel combined with VBA scripts open up a whole world of
possibilities.
In the past, here at MUO, Ive shared a few of the things Ive done with Excel and VBA, like
exporting Excel data into Word (http://www.makeuseof.com/tag/integrate-excel-data-worddocument/) or sending out emails straight from Excel (http://www.makeuseof.com/tag/sendemails-excel-vba/). Of course if you arent much of a coder, you can always get Excel
applications someone else has written, like those listed by Simon
(http://www.makeuseof.com/tag/top-3-websites-download-free-excel-programs/).
However, if youre serious about using Excel to manage more of your life, then you should take the time to learn how VBA coding works. To
help with that, Ive decided to share a Automation spreadsheet that Ive created to manage different areas of my life. This spreadsheet has
4 tabs and covers everything from grouping links of URLs that I want to launch all at once, to managing my debt and paying it off faster.
If you want to enhance your use of Excel, I invite you to follow along as I share a few of these designs and simple scripts that I used to
accomplish these tasks.

Managing Your Life With Excel


Microsoft Excel is not just a data spreadsheet. It is actually a design platform for applications. If you look at it that way, you may realize just
how much you can accomplish with the application.
Look at a sheet as a design board where you can place Visual Basic form objects like command buttons, dropdown boxes, textboxes and
anything else at all. Not only can you place them anywhere on the sheet, but you can use those objects to interactively (or automatically) add,
remove, or manipulate information on the sheet.

Monitoring Your Websites

Ive tried a lot of different tools to ping the different websites that I manage, like the ICMP Ping Manager
(http://www.makeuseof.com/tag/monitor-network-devices-websites-icmp-ping-manager/). But, not long ago I discovered a way to ping
websites from right inside of an Excel VBA script. That meant, I could add a sheet to my Automation workbook that would ping all of the
websites that I manage, and put the results into a cell next to the website name.
This is how I laid out the sheet.

The number 4 in cell B1 is used to display the count of websites that Ive installed on the sheet. This will allow the script to only count
through the number of cells that actually have sites listed, started at A3.
The code to accomplish this looks like this:

DimintSiteCountAsInteger
DimintCountAsInteger
DimoPingAsObject,oRetStatusAsObject
DimsHostAsString
DimsPingAsString
DimintColAsInteger
DimintRowAsInteger

intSiteCount=CInt(Sheet1.Cells(1,2).Value)

intRow=3

ForintCount=1TointSiteCount
sPing=""
Sheet1.Cells(intRow,2)=sPing
intRow=intRow+1
Next

intRow=3

ForintCount=1TointSiteCount

sHost=Sheet1.Cells(intRow,1)

SetoPing=GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery_
("select*fromWin32_PingStatuswhereaddress='"&sHost&"'")

ForEachoRetStatusInoPing
IfIsNull(oRetStatus.StatusCode)OroRetStatus.StatusCode<>0Then
sPing="PingFailed"
Else
sPing=sHost&"PingSuccesson"&Now()&Chr(10)
sPing=sPing&"Time(ms)="&vbTab&oRetStatus.ResponseTime&Chr(10)
sPing=sPing&"TTL(s)="&vbTab&vbTab&oRetStatus.ResponseTimeToLive
EndIf
Next

Sheet1.Cells(intRow,2)=sPing

intRow=intRow+1

Next

The first For look at the top just goes through the results cells and clears the results from the last time I ran a check. The second FOR loop
counts through the rows listing the websites, starting at the third row (intRow-3), performs the Ping command (the Set oPing line), and then
returns the results into column B (Sheet1.Cells(intRow,2) = sPing).

Heres how those results look after the script runs.

The results column shows whether the ping was successful, and the Time/TTL details.
If you arent familiar with adding command buttons to an Excel sheet, you can add the button from the Developer menu, and clicking on the
Sign up for more tips and awesome articles

Email

Let's go

Insert button and choosing the button from the list. Draw the button onto the sheet, right click on it, and then select Assign Macro.

Type the name of the Macro for that button, and click on New.

This will open up the code screen where you can insert the code from above.

Maintaining a Library of Link Groups

On another tab, I also started to organize the group of links that I use to perform certain tasks. For example, when I write for MUO, I like to
open up the MUO WordPress editor, google, and our Google Docs page for topics. When I research for Top Secret Writers topics, I like to
open a few standard media pages.

When I click the Launch Group button, it will launch the default web browser and open up all pages in that group. Heres how the script for
each button looks:

DimintSiteCountAsInteger
DimintCountAsInteger
DimintColAsInteger
DimintRowAsInteger

intSiteCount=CInt(Sheet2.Cells(4,3).Value)
intRow=5

ForintCount=1TointSiteCount
ActiveWorkbook.FollowHyperlink(Sheet2.Cells(intRow,2))
intRow=intRow+1
Next

This script is simple but effective. The secret to this one is the FollowHyperlink function. This code will check the number of links defined in
the cell just to the right of the group title, and knows to run through that many links before the title. For each button, the location of the link
count, and the column being used needs to be manually typed into the code, but the rest of the code is identical for each button.

Previewing your Picture Gallery

On the next tab of my automation worksheet is where I go when I want to quickly run through all of the images in my pictures folder. I do this
because I place more than just images in that folder, and want to see all of the files that I have there.
Heres what it looks like after clicking the Preview Pics button.

Right now I manually update this sheet by deleting all pictures from the B column, and then clicking on the Preview Pics button.
The button runs the following script:

DimmyPictAsStdPicture
DimstrFilePathAsString
DimintRowAsInteger
DimmyPictNameAsVariant
DimmyCellAsRange
DimsPictureAsString
DimstrTestAsString
DimmyRngAsRange
DimintSkipAsInteger

intRow=2

strFilePath=Sheet3.Cells(1,3).Value

SetmyObject=NewScripting.FileSystemObject
SetmySource=myObject.GetFolder(strFilePath)

OnErrorResumeNext

WithSheet3
SetmyRng=Sheet3.Range("B2",.Cells(.Rows.Count,"B").End(xlUp))
EndWith

ForEachmyfileInmySource.Files

'Ifpictureisafile
IfRight(myfile,4)=".gif"OrRight(myfile,4)=".jpg"OrRight(myfile,4)=".bmp"OrRight(myfile,4)=".ti
Sheet3.Cells(intRow,1).Value=""
Sheet3.Cells(intRow,1).Value=myfile.Name

intSkip=0

ForEachmyCellInmyRng.Cells
IfintSkip=1Then
WithmyCell.Offset((intRow3)+1,0)
Sheet3.Shapes.AddPicturemyfile.Path,msoCTrue,msoCTrue,.Left,.Top,125,125
EndWith
EndIf
intSkip=intSkip+1
NextmyCell

EndIf
intRow=intRow+1

Next

The secret of this script is using the StdPicture object, which lets you sort of overlay pictures at the location of certain cells, by defining the
left and top properties of the picture to match that of the cell. Just make sure to size the cells slightly larger than what you define in the code.
In my situation I used 125 height and width for the pictures, so my cells are set slightly larger than that ahead of time.

Managing Your Debt

The final tab that I want to share is actually one that I wrote a while back about using Excel to create a personal budget
(http://www.makeuseof.com/tag/excel-spreadsheet-techniques-to-make-a-personal-budget/).
The most important concept that I wrote about in that article, and one that belongs in any article about using Excel to manage your life, is
using Excel to calculate how the snowball effect can help you pay down your debt.
The concept is pretty simple. List all of your credit card debt side by side in a sheet, with two columns per debt total balance and payment.
The calculation for each subsequent payment cell is PrevBalance + (PrevBalance * 0.10/12) last payment

Then you can drag all of the values down the sheet and theyll recalculate, showing how quickly your balance will drop as you make those
payments. As you can see, making one payment per debt until each debt is paid will eventually pay off each individual debt.
But thanks to the quick calculating power of Excel, you can determine when balances will be paid off, and at that point take the minimum
balance for that card and move it over to another card not yet paid off. As the spreadsheet shows, each subsequent balance gets paid off
much faster.

Excel allows you to calculate and visualize quickly how your payments will affect future payoff dates, and it also gives you a schedule to look
back at while youre trying to make sure that youre right on track in paying off those debts.
As you can see, Excel is a very powerful tool when it comes to managing all aspects of your life whether its your work, managing files, or
your budget.
Do you have any unique uses for Excel to manage your own life? Share some of your own tips and advice in the comments section below.

Image Credit: magnifying glass via Shutterstock (http://image.shutterstock.com/display_pic_with_logo/293770/293770,1327945531,10/stock-photo-magnifying-glass-andworking-paper-with-diagram-93920143.jpg)

Share

Tweet

Pin

Stumble

Bookmark

Mail (mailto:?body=http://www.makeuseof.com/tag/microsoft-excel-manage-life/&subject=How To Use Microsoft Excel


To Manage Your Life)

You might also like