Book Image

Excel 2010 Financials Cookbook

By : Andre Odnoha
Book Image

Excel 2010 Financials Cookbook

By: Andre Odnoha

Overview of this book

<p>Excel is one of the mostused software tools in the world and just about every business has a copy somewhere. Despite its power and flexibility it is not always clear how to use it to perform some of the most important tasks in any business: organizing, analysing, and presenting financial information.<br /><br />Excel 2010 Financials Cookbook contains a rich collection of useful techniques for handling financial data in Excel. From integrating data from a variety of different sources, through organazing and analyzing financial data, to presenting it in a variety of graphical forms, this book has you covered.<br /><br />The book deals first with "normalizing" financial data -- that is, bringing data from a number of different sources into a single format where you can analyze them together. Then you'll learn techniques for managing and analyzing the data before discovering ways to present it graphically. The book then looks at Excel's built in features for financial analysis, and even shows how you can combine the built in features to build your own analysis functions.</p>
Table of Contents (14 chapters)
Excel 2010 Financials Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Converting dates with code


Financial data usually contains dates; however, date formats are not standard between applications, worksheets, or countries. It is often necessary to make modifications to the date format in order to expedite analysis and adhere to local formatting standards.

In this recipe, you will learn to create an add-in that will allow you to quickly change the date format of a selection of dates within your financial data.

How to do it...

We will begin this recipe by adding code to the Excel worksheet:

  1. 1. In the worksheet that you wish to add the add-in, press Alt + F11 to open the visual basic editor (VBE).

  2. 2. Once open, from the toolbar choose Insert | Module, to insert a blank code module:

  3. 3. Enter the following code:

    Sub DateConvert()
    Dim rDate As Range
    Dim dFormat As String
    Dim iCell As Range
    Set rDate = Selection
    dFormat = InputBox(—Enter the new Date format—, —Date Format—)
    For Each iCell In rDate
    iCell.NumberFormat = dFormat
    Next iCell
    End Sub
    
  4. 4. Save your work and...