by Excel MVP Bob Umlas Holy Macro! Books PO Box 82, Uniontown, OH 44685 Excel Outside the Box 2012 by Bob Umlas and Holy Macro! Books All rights reserved. No part of this book may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information or storage retrieval system without written permission from the publisher. All terms known in this book known to be trademarks have been appropriately capitalized. Trademarks are the property of their respective owners and are not affiliated with Holy Macro! Books Every effort has been made to make this book as complete and accurate as possible, but no warranty or fitness is implied. The information is provided on an as is basis. The authors and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book.
First Printing: January 2012
Author: Bob Umlas Technical Editor: Joseph Sorrenti Copy Editor: Tyler Nash Layout: Nellie J. Liwam Cover Design: Shannon Mattiza, 6Ft4 Productions Publisher: Bill Jelen Indexer: Samuel T. Sharkowski Published by: Holy Macro! Books, PO Box 82, Uniontown OH 44685 Distributed by Independent Publishers Group, Chicago IL ISBN 978-1-61547-010-5 print, 978-1-61547-303-8 ePub Library of Congress Control Number: 2011937995 About the Author Bob Umlas works for a major tax and accounting firm, using Microsoft Excel eight hours a day, writing custom applications for staff and clients. He has been using Excel since version 0.99 (on the Macintosh)! He was a contributing editor to Inside Microsoft Excel for many years, a magazine devoted exclusively to Microsoft Excel and published by The Cobb Group and later Ziff-Davis. At the time, most issues contained either an article by Mr. Umlas on using VBA (Visual Basic for Applications) or some tip or technique from him on using Excel.
He has had more than 300 articles published on subjects ranging from beginner to advanced macros, and on tips, shortcuts, and general techniques using virtually every aspect of Excel. Mr. Umlas was voted an MVP (Most Valuable Professional) by Microsoft each year since 1995 for his contributions to the various online Forums about Excel, and is known world-wide for his contributions in Excel. As an MVP, he meets yearly with his fellow-MVPs at Microsofts headquarters in Redmond, WA, where he has access to the product developers. He has been a beta tester for new versions of Excel since version 1.5, and was asked by Microsoft for his input for newer versions of Excel. In 1995 he led a session called Maximizing Excel Development Using Array Formulas at Microsofts Tech Ed Conference in New Orleans, and he led a session called Tips and Tricks at a Microsoft convention in New York City.
He has also led two Excel sessions (Array Formulas, Tips & Tricks) at the Advisors Developer Conference in San Francisco in February 1998. Most recently, he led five sessions at an Excel User Conference in Atlantic City on Tips & Tricks, Array formulas, VBA, Formulas, and Userforms. He has led about seven or eight of these user conferences since 2005. He is also the author of This isnt Excel, its Magic! which is available from http://www.iil.com/publishing as well as from Amazon.com. (There are two versions of this book: One for Excel 2003, and one for Excel 2007). Mr. Mr.
Umlas used to co-lead the New York PC Users group on Excel every month for about 10 years. He has been teaching Excel to individuals and corporations for several years. Currently, Mr. Umlas leads a 12-hour class in Excel called Excel in Depth and a 6-hour class on VBA(see http://www.iil.com, click on Virtual Classroom,then click on Virtual Classroom Schedule, choose Microsoft Excel in Depths, click See your selection, click Course Outline). Comments from readers: This book from the Excels Gurus Guru Bob Umlas will satisfy the Excel superstar in every office. Master tricks that mortals would think are impossible with Excel.
The formulas in this book will solve every bizarre Excel problem. Bill Jelen, MrExcel.com, Excel MVP The hidden power of Excel with excellent examples, expertly explained by Bob Umlas Roger Govier, Excel MVP A book full of ingenuity Bill Manville, Excel MVP Seemingly impossible Excel challenges made simple! Another excellent book for the intermediate to advanced Excel addict, by Excel emperor Bob Umlas Jan Karel Pieterse, Excel MVP Acknowledgments I want to thank my fellow Excel MVP folks who were kind enough to read through this manuscript and make corrections, suggestions, etc. So thanks to Dick Kusleika, Jon Peltier, Richard Schollar, Ron de Bruin, Rick Rothstein, Jan Karel Pieterse, Roger Govier, Niek Otten, Bill Manville, Greg Truby, and especially Bill Jelen. I also want to thank my official technical editor and coworker, Joseph Sorrenti for his willingness to read through all the material and make suggestions for improvements and additions, as well as finding some typos! I want to thank my wife for all her support of my taking the time ( our time) to write this book as well as her unending love. Shes an author herself (The Power of Acknowledgment), so she knows what goes into the creation of a book. I also want to thank the Microsoft MVP program without which I would not have met such knowledgeable others to give a second look at the materials presented here.
Dedication I want to dedicate the book to my family (wife Judy, son Jared, daughter Stefanie, son-in-law Shaun, granddaughter Lilith) and also to my fellow MVPs.
Introduction
There are many Excel books out there, why did I write this one? My daily work involves writing custom applications using Excel, and there are many problems Ive had to think through to come up with a solution in Excel. Ive used these solutions many times in my applications. I have not found any books or articles which described similar issues and solutions, yet it is hard to imagine that Excel developers in other companies hadnt also come up against these issues. So, given the feedback from my previous book (This isnt Excel, its Magic), I thought it was time for another book to help the already-advanced Excel developer get past these hurdles. So many times Ive seen a data validation list contain many blanks at the bottom of the list (which was fixed in Excel 2010!), or with gaps, like this:
when it should look like this:
Even if the source contains those gaps.
I describe how to fix that (and so many more things) in this book. I show a lot of involved formulas but I decipher them step by step so theyre no longer so formidable, like this array-entered one, for example: =INDEX(A:A,SMALL(IF(ISNA(MATCH($A$1:$A$12,$C$1:$C$9,0)),ROW($1:$12),),ROW(A2))) This book is aimed at the companys already-expert Exceller, elevating him/her to the next level. Bob Umlas
Chapter 1 - Techniques
1-A Dilemma with Relative References
show a simple worksheet normally and with formulas showing: