You are on page 1of 47
earn Microsoft Excel at Advanced Level ie me triceewn tor ely eaica linking workbooks to recording macros The Essential How to Do Guide = Mark Taylor Bs Published by Mark Taylor Publishing partner: Paragon Publishing, Rothersthorpe Firse published 2009 © Mark Taylor 2009 ‘The rights of Mark Taylor to be identified as the author of chis work have been asserted by him in accordance with the Copyright, Designs and Patents Act of 1988. All tights reserveds no part of this publication may be reproduced, scored in a retrieval system, or transmieed in any form or by any ‘means, electonie, mechanical, photocopying, recordingor otherwise wihoue che prior written consent of the publishers or cence ppermitsing copyingin the UK issued by the Copytight Licensing Agency Led, $0 Tortenham Court Road, London WIP 9HE. ISBN 978-1-899820-77-1 Book design, layout and production management by Into Print ‘wwwintoprinenet Printed and bound in UK and USA ightning Source CONTENTS EXERCISES: Linking Workbooks. — a Landline phone aecOUNtusnnennnnnnnnnennsnn 1S Mileage Calculator. Loan repayment calculator. Updating stock and sles levels. Runninga system from a user form Using user form co encer daca & setting up 2 macro co center names, es 4 8 Insurance Quote exercise 4 Learn Microsoft Excel — Advanced Level NTRODUCTION The aim of this book is to introduce ro the individual or business how to design spreadsheets in different ways. Later exercises contain macros which are easy o record, Once you have picked up the principles behind chese macros, you will be able co command any spreadsheet to do what you want, much more efficiently and effectively ‘n Microsoft Excel — Advanced Level 5 Exercise 1: Linking Workbooks Mididledare Foods isa dairy producer that supplies mainly fresh liquid dairy ingredients co food manufacturers Food diseribucorsand direcly in some cases to industrial caterers, cafeterias and restaurants inboth the UK and the EU. In this exercise we are going to link workbooks effectively so they “will keep maintained as longas the company still operates In the month of April, Middledare Foods keeps adaily record ona spreadsheet ofall invoices. pen a new workbook and type in che daca as show in che figure below: a idee Food Sees oie dt nie tum Comer Type Product uanty RaPice SalesPice t1n209 Fess a 2 TS] vince Gay Fests a ea ig] vinci) sD Maines om ipa SON ainBether m fe] rowan sau Fase x a cz Shen ~ st (zo Shenass % 2 nz 10 Foire ™ re) weco 507 snes ™ a nao) 8 Gee Patees ™ cag Foi a a aco 10 Shewase ™ so gucci nt Caan aie a a Out aanBees AL 8 uz 100 Fein x Ft) Deuezo «ME Geen Pastes AL a aon tS WainBaes m auc 6 cake an x 4 nz 1 ay ads 3 onc 010 Sao * a pez 019s a Ey suze 0 See x ro Figure 1.1: Daily sales invoices of Middledare Foods Save this workbook as Middledare salesals 6 Learn Microsoft Excel — Advanced Level The application designer of the company has also decided it best co have a workbook containing a products table and a workbook containing a customers table. ‘This will allow links to save che user from typing repetitive information, and allow more information to be added, This could be anew product in the products table or to add a new customer inthe cuscomer rable Open a second workbook and type in che dataas shown in the figure below: AT B ae a) ]Products 4 3)ProductCode Description Retail Price per Likg| | ‘A1 Whole Milk £0.19 3 ‘A2 Semi Skimmed| £0.22 a ‘A3 Skimmed Milk £0.27 7 ‘AA Soft Cheese £2.49 a ‘AS Salted Butter £1.62 3 ‘AG Unsalted Butter__£1.55 Figure 1.2: Products table of Middledare Foods Save this workbook as Middledare Products.xls 8 Learn Microsoft Excel — Advanced Level Selec column Band name it InvoiceNum, Note: Remember not to leave a gap beeween words and always press Enter. Aleernatively underscore the two words you are using for example column heading Invoice_Date and press Enter. Repeat this process throughout the worksheet. The next step isto name the range of data. Highlight columns A to H in MiddledareSales workbook, and in the name box next to the formula bar name it SalesTable. Save your workbook. Do the same for your Customer & Product workbooks by highlighting each column containing daca individually and naming the column after its column heading. ‘The Products workbook and Customers workbook will also need to be named, as they will be used asa look up table so do the following In the Products workbook, dragand oceupy across columns A co C. In the name box type the name ProductsTable, and rename sheet 1 ProductsList. Right click the sheet tab and select Rename, In the Customers workbook dragand occupy columns A & Band name the range, CustomerTable, Rename Sheet 1 CustomerList. Save workbooks. The workbooks have had their columns named individually and there workbooks named. Excel should now be able to look up values from other worksheets, Iemay bea good idea to have a back up copy. Open up Middledare Sales workbook and rename sheet! Invoices. Right click on mouse and select Move or Copy. Highlight the Invoiees worksheet and check the Option button Create a Copy toa new workbook. Name this workbook Middledare Sales Backup.xls, and Save. Learn Microsoft Excel — Advanced Level 9 Always use your original Middledare Sales.ls workbook for entering new data witha dara form, Your copy is usta safeguard in case data getslost or damaged. Save your backup copy by creating copy again co Middledare Sales Backup.als each time you save your original Sales workbook You can of course Move or Copy your other two worksheets ProducrsList and CustomerList to yourall in one workbook. Remember this will only act asa backup copy: The links will only -work you change daa in the separate workbooks ie: Middledare Produccsss, Middledare Salesxls or Middledare Cuscomers.xls Ifyou changed data in your backup copy it would nor change the links wiehin your separate workbooks Protecting she workshest. “Highligh all the columns chat contain daca which should nor be changed until necessary to do so, such a che Products table and the Costomer rable. ‘To protect the worksheet select Tools, Protection, Protect sheet or from the Format menu select Cells, or click on Review, Protect sheet and tick che locked cells checkbox. ‘You could enter a password here, bu it's bes eaving he password box blank, incase you forgee the password. You would not beable to edit the worksheet without che password. The worksheet will stil be protected from accidental changes, wichout a password. ‘To Edit che procected sheer selece Tools, Protection, Unprovect sheet or Review and Unprotect sheet Open upall three workbooks at once. Remember this is cick on cone of the workbooks and with your finger pressed doxen on Cerl highlight the other ewo workbooks and open. Click on Window or View, Arrange and Tiled. Open up Middledare Food sales workbook. We are now going ro find che type of customers we deal with, 10 Learn Microsoft Excel — Advanced Level ‘A lookup value can be found using formulae. You either wrice the formula in the formula bar or use a formula cable. Clickon the functions tab, nexe co the functions bar and select vlookup. Fa liarise ourself with the formula box, that has shown up. {entation cant anenins Le Cet Figure 1.4: Formula Table aye ostemet [Jeane Tobleaoy Castomeitit!CasbmesTable )=CMame" Type" (at a? ror bao Foise Figure 1.5: Completion of Function Argument Learn Microsoft Excel — Advanced Level ll “The filling in of Customer type in Middledare Food Sales Workbook. Selece Dé in the Sales workbook. To find this value we must use logic “The value we want ro look up must be customer, asin che customer workbook we have che customer and rypes listed. Your cursor should be on lookup_value in the Formula box. Click on the column named Customer in the Sales workbook and i should show the look up value as Customer” This s because you named the column, On your right ie will say, Friesland Now move down to table_array. The table we need to look up to find the type is to go into the Castomers lise worksheet. First drag across the column headers in che able. Teshould say [MiddledareCustomers.xls] CustomerLise!CustomerTable, Ir should say [MiddledareCustomers.xls] as this is the workbook. Ir should say CustomerL ist! as this is the sheer and CustomerTable asthisis the range. You named the workbook, sheet tab and table catlie. ‘Note: “The formula must be shown exactly. Iecan take some time to get right. Sometimes you might have included absolute references that you did not need. Delete these inthe formula bar. Absolute references can be used if you have not gor the CustomerTable, pare in your Formula, Instead after customer li highlight ehe table and this wll produce your absolute references. We will learn more about these later. fat any time you repeat some of the formula, you must delete that part

You might also like