Author Archives: Chris Mortimer

Working with Excel VBA Message Boxes

Tell the user what is going on and build their confidence in your spreadsheet

Click here to download the STARTER example file used in the videos.
Click here to download the COMPLETED example file used in the videos.

A true story…

We are currently working on a spreadsheet development project here in the UK. The project involves updating a ‘legacy’ spreadsheet – one that has been around for a while. It’s a typical situation in which we might intervene: the file has bits and pieces ‘bolted on’, and the person who was in charge of it has left the business. It’s causing anxiety.

The spreadsheet contains various buttons and macros that run on workbook events including opening the workbook, some of these macros are very powerful. Here is the thing: nobody actually knows what happens when the buttons are pressed. People are aware that some code runs, but the consequences of the macros are mixed at best: some reports are created but, elsewhere, inputs disappear and formats changed for no apparent reason. The client team is frustrated.

Excel VBA Message Boxes

What is missing here is helpful user interaction. The applications we develop must communicate with users to build their confidence in the file. One example is asking for permission to run a macro, and making sure the the user is aware of any adverse consequences such as losing pre-existing data; another example is notifying the user that a macro has run, and providing some helpful summary information from the analyses generated. Both are examples of a critical success factor in spreadsheet development: helpful user interaction. So, how do we use Excel VBA message boxes to create helpful user interaction?

This video series teaches you the basics of Excel VBA messages boxes. With the building blocks provided, you will be able to create powerful, dynamic message boxes that provide the user with the information they need, when they need it. First, we cover a simple message box. Then, we look at two possible applications of Excel VBA message boxes: first, to seek permission from the user to run a macro; second, to report back to the user after a macro is run. So, let’s get into it!

Video 1 – Simple Excel VBA Msgbox

In the first video, we look at how to create a simple message box. From the outset we deploy powerful coding concepts – we use activecell.value, for example, to make the message box display what is in the selected cell; this lends the message box a dynamic quality – it responds to different situations and provides appropriate feedback. We will harness this dynamic quality later. We also look at how to change the title of the message box from ‘Microsoft Excel’ – we don’t want Bill Gates taking all the credit!

Video 2 – Excel VBA Message Box for Confirmation

How can you (re-) build user confidence in your spreadsheet? One way is to ask the user to ‘commit’ to decisions using a confirmation message box before running code. We are all familiar with this idea from online forms and pieces of software – we are told what will happen, and given the opportunity to proceed, or to reverse the decision. This is particularly important in the spreadsheet environment where users may not be used to macros doing work for them. Correctly implemented, this kind of feature can build user confidence and supports user interaction – strong user interaction is one of the features of professional Excel applications. The important mechanism here is a ‘Yes / No’ message box combined with a conditional statement to take the code in one of two directions. Cool!

Video 3 – Excel VBA Message Box for User Feedback

The final application focuses on using message boxes to provide user feedback. We think that ‘involved’ macros (ones that take some time / do a lot of work) should be ‘book-ended’ by two message boxes – one to seek confirmation (above), and the other to indicate the macro has finished. The second message box, moreover, is an opportunity to provide some timely feedback for the user. Why make the user look for a critical piece of information in a spreadsheet when you could flash it up in a message box? This kind of user feedback further improves user interaction and should build user confidence in your application.

What did you make of the Excel VBA messages boxes series? These techniques should allow you to improve user interaction in your spreadsheet application, and create that ‘wow’ factor. Good luck! We would love to know how you get on – contacts below.

For regular spreadsheet hints and tips and more on the #ExcelRevolution:
https://www.facebook.com/TigerSpreadsheetSolutions

Contact us here.

Posted in Advanced Articles, Excel Guidance Articles, Excel Guidance Videos & Articles, Intermediate Articles, Uncategorized | Comments closed

Excel VBA IF Conditional Statements for Beginners

Excel VBA IF statements can take your VBA coding to the next level

If you’ve learned the basics of VBA coding (perhaps you’ve watched our popular VBA for Beginners series), you’re ready to move to the next level. What is next? Excel VBA IF statements move you towards more advanced coding, and more powerful macros. You may have wondered how we tell Excel to execute only part of a routine, according to a value in a cell, or something else. This is the basic idea behind an Excel VBA IF (‘conditional’) statement.

Excel VBA IF

This series teaches you three techniques for dealing with a ‘conditional’ situation. These techniques are the techniques we use in our Excel development projects. But first, what is an Excel VBA IF statement? Why ‘if’?

Conditional statements allow us to instruct Excel to execute code only if a certain condition is met. A condition could relate to any object in Excel, but typically a condition relates to a value in a cell or VBA variable. For example, you might wish to count how many entries in a database are ‘male’, or write the word ‘male’ next to all the ‘male’ entries. In each case, we would ask Excel to do something only if a certain condition is met, in this case if the letter ‘M’ appears in a cell.

Got the idea? OK, let’s get into the first video! Don’t forget to download the files and work along with Chris.

Click here to download the STARTER example file used in the videos.
Click here to download the COMPLETED example file used in the videos.

Video 1 – Simple Excel VBA IF Statement

In the first video, we learn how to create a simple if statement. A simple if statement involves just a single line of code, and is relatively easy to set up. In this example, we ask Excel to flash up a message box to tell us if an entry in a database is ‘male’ or not. You’ve just created your first Excel VBA IF statement. Well done, onwards!

Video 2 – IF – ELSE – END IF

So, we know how to ask Excel to do something if a condition is met. But, what if a condition is not met? What if we want Excel to notify us if the entry in the database is not a ‘male’? The next technique is IF – ELSE – END IF.

This technique allows us to direct the code in two directions. But, the required coding construct is more complicated and often confuses beginners; when using IF – ELSE – END IF, we have to remember that the instructions must begin on a new line. A simple if statement requires just a single line of code; IF – ELSE – END IF incorporates another condition and requires at least 5! One for if, else, end if, and at least one line for the instructions if the condition is met, and the instructions is the condition is not met. Don’t worry too much about it at this stage – just follow along with the video.

This can seem ‘code-heavy’; but the power of the routines, in our view, justifies the effort required to learn the syntax. In the video, Chris creates a routine to count up the number of males and non-males and in the database. The loop / conditional statement combination is VBA at its best; you can see how these techniques combine together beautifully to get a job done quickly. Chris even has time to validate the routine by using spreadsheet formulae to reach the same outcome. Nice!

Video 3 – Select Case

Oh no, more new syntax! Yes, select case is a new construct for us. But, this technique opens up a new world of possibilities. So far, We’ve dealt with conditional statements that direct the code in one or two directions. Select case allows us to direct the code in any number of directions, and even includes a ‘catch-all’ condition too. It is supremely flexible and powerful, and regularly features in our Excel development projects.

Chris implements select case in the video to count up the number of entries in three age categories (eg. 30-59 years old) in the database. But, he does not complete the report. Can you combine select case with a loop to get the information that the ‘client’ requires? Reference techniques from video 2, and let us know how you get on.

What did you make of the Excel VBA IF Conditional Statements for Beginners series? With these three techniques, we are confident you can deal with most situations where a conditional mechanism is required. Good luck!

For regular spreadsheet hints and tips and more on the #ExcelRevolution:
https://www.facebook.com/TigerSpreadsheetSolutions

Contact us here.

Posted in Advanced Articles, Excel Guidance Articles, Excel Guidance Videos & Articles, Intermediate Articles, Uncategorized | Comments closed

Excel Learning Tips: My Story

Chris’s Spreadsheet Story and 3 Excel Learning Tips

By Chris Mortimer

There can be no doubt about it, Excel is difficult!

You’re on an Excel learning website, so you’ve probably felt that difficulty yourself. In the below video, I talk about my spreadsheet story – how I got into spreadsheets, the difficulties I encountered and how I got over them. I share three Excel learning tips that I hope will push your spreadsheet skills forward.

Spreadsheet Story Still

In the below video, I talk about (1) finding an access point, (2) the importance of a mentor, and (3) the impact of good learning resources. What is your spreadsheet story? Tell me – leave a comment below the video on the YouTube channel.

Excel Learning Tips 1/3 – FIND AN ACCESS POINT

When people think about Excel, they tend to think about numbers. This leads to the misconception that spreadsheets are the preserve of statisticians and computer programmers. In the video, I argue that a spreadsheet is actually a social and visual problem as much as a technical, numbers-based one. This is because, to my knowledge, a spreadsheet has never created itself! A spreadsheet is created by a human being to help them do something. Further, a spreadsheet that cannot be understood is not useful, regardless of how powerful it may be; it must be well-presented. Therefore, spreadsheet development actually calls on visual and social skills as well as numbers-based ones.

I find this point of view intriguing (well, it is my own ;-)) and incredibly empowering. It opens up a topic that is considered ‘difficult’ to most people – because most people are confident with some aspects of social, visual or technical problems. With this in mind, you have to find your access point. Are you ‘artistic’? If so, you can arrange the elements of the spreadsheet in a way that helps the user assimilate the information. Do you like interacting with customers? If so, you can get started by understanding user needs and creating a detailed specification. After you have identified your access point, you can build other skills from this enclave of competence and confidence.

Excel Learning Tips 2/3 – FIND A MENTOR

Excel is a piece of technical software that, without specialist skill, is difficult to use. Too many people are asked, wrongly in my view, to ‘get Excel to work’ without the proper training. A critical factor for many successful Excel users is finding somebody to help. I was lucky to have helpful colleagues on my Masters programme, and some excellent lecturers. These people humanised a complicated topic and helped me through the early stages. So, try to find your mentor. If you’re looking for somebody to help you, bear in mind that skilled Excel users often like talking about spreadsheets! They may be happy to share their knowledge. So, approach somebody you work with or somebody you know, and ask them to help you. You may find they are flattered by the invitation.

Excel Learning Tips 3/3 – GET SOME LEARNING RESOURCES

‘Excel’ as a learning topic consists of multiple sub-topics: modelling, data analysis, VBA programming etc. You need a plan to navigate these sub-topics and organise your learning. I have often seen people get lost in ‘rabbit holes’ – obscure topics that don’t deliver much value. Now, this article is not a sales pitch for my YouTube channel, but it might be a starting point. I organise the video series so that these sub-topics can be easily understood, and so that the learner can work along with me and develop the skills. There is a multitude of Excel learning websites out there – find one that suits your learning style, and use the resources to navigate Excel as a learning topic.

I hope these three Excel learning tips help you with your learning journey. Good luck, and let me know how you are getting on.

What is your spreadsheet story? What stage are you at with your Excel learning? Leave a comment below the video on the YouTube channel.

Posted in Advanced Articles, Advanced Videos, Beginner Articles, Beginner Videos, Excel Guidance Articles, Excel Guidance Videos, Excel Guidance Videos & Articles, Intermediate Articles, Intermediate Videos, Uncategorized | Comments closed

Excel Database Formulae For Beginners

Create cool database analysis quickly with Excel Database Formulae for Beginners!

Excel is great for logging data and keeping small databases. But, very few people know how to get the analysis they need from the data quickly and without too much stress! Too often, people resort to sorting data and splitting up the database to simplify the problem; but, this ‘critical mistake’ complicates the workbook and is often counter-productive. What are the alternatives?

Click here to download the STARTER example file used in the videos.
Click here to download the COMPLETED example file used in the videos.

Excel DB Pic

Correctly applied, Excel database formulae allow us to get the analysis we need quickly and without too much stress. A few hours learning the skills could have a dramatic impact on your work. Make sure you download the exercise files (above) and work along with Chris. Enjoy!

Video 1 – Introduction to Excel Database Formulae

In the first ‘in-car’ video, Chris talks about the real-world motivation for the series, and the value of the techniques covered. Excel offers a vast array of functions; but, we believe, not all are required to reach a good level of competence. Rather, a subset of techniques learned effectively can deliver disproportionate benefit. The powerful Excel database formulae covered in this series fall into this subset of important techniques. Chris also talks about a ‘critical mistake’ in spreadsheet development – how users tend to split up databases across multiple sheets in order to make the analysis easier. This actually serves to complicate matters and will discourage the user in the long run. Command of Excel database formulae allows you to get the analysis you need without complicating workbook structure.

Video 2 – COUNTA and COUNTIF

The first techniques video covers two basic formulae that are essential for working with databases. The COUNTA formula tells us how many entries are in a database, and the COUNTIF formula allows us to answer ‘single criteria’ questions such as ‘how many females are there in the database?’ Remember to download the spreadsheet files (link at the top of this article) and work along with Chris. Throughout this series, we use PC keyboard shortcuts to navigate Excel and speed up / de-stress the formula-building process. Try the keyboard shortcuts yourself and get Excel working for you like a pro!

Video 3 – SUMIF and AVERAGEIF

COUNTIF allows us to identify how many records conform to a particular ‘criteria’, or piece of information that interests us. The SUMIF and AVERAGEIF formulae allow us to perform an operation on records that conform to a criteria. What do we mean by an ‘operation’? The operation that SUMIF performs is to aggregate the data, whereas AVERAGEIF returns an average of data that interests us. So, you can get important summary measures such as aggregates and averages for subsets of the data without having to sort or split up the database. Cool! Throughout the series, Chris checks the accuracy of the Excel database formulae by sorting the database and applying a simple formula, effectively getting the same result a different way. It is good practice to ‘validate’ your analysis like this – it should help build confidence in the values that the database formulae return.

Video 4 – COUNTIFS

In this video, the Excel database formulae start getting really interesting! We move onto the topic of multiple criteria questions – analysis in which we wish to include data that conform to two or more pieces of information. How many males from the North region are in the database, for example? We deal first with the COUNTIFS formula. The COUNTIFS formula is similar to its close friend the COUNTIF (singular) formula, but allows us to include any number of criteria, whereas COUNTIF allows just one. The formula returns the number of records in the database that conform to all of the criteria we specify. With this level of sophistication, the formula can be tricky to build. Particular attention has to be paid to references and use of absolute, relative, and partial absolute references. Chris discusses references in the video and provides his tips for getting them right throughout the series. Trial-and-error is key!

Video 5 – SUMIFS and AVERAGEIFS

In the fifth video in the series, we deal with more ‘multiple criteria’ questions. In this case, we wish to do more than simply count entries that conform to multiple criteria; we actually want to perform an operation on the data – calculate an aggregate (SUMIFS), or a mean average (AVERAGEIFS). Chris works through each of these formulae step-by-step, building two analysis tables that provide powerful insights on the dataset. All in just over 15 minutes! Hopefully you’re now feeling the power of the formulae and can see applications in your real-life situation…

Video 6 – DSUM and DAVERAGE

The sixth and final techniques video in the series marks a departure from the previous formula-building approach. We examine two powerful Excel database formulae – DSUM and DAVERAGE. These formulae offer new possibilities: rather than having to edit a complicated formula to get the analysis we need, we can simply enter values into a table and watch the outputs change, cool! There is a trade-off however, setting up these formulae requires some preparatory work, and maximum precision is needed to get the formulae working. Once set up and validated, however, they provide quick, powerful, user-friendly analyses. We have found that on our real-world projects, the DSUM and DAVERAGE formulae can have a dramatic impact. Make sure you work along with Chris and get these Excel database formulae working for yourself.

Video 7 – Excel Database Formulae – Reflection and Discussion

In the final video of the series, Chris discusses an important issue in applying these formulae in the real world – how to account for a database that is changing in size. It is unlikely that your database is ‘static’; rather, you would want to add data to it over time. How can we set up the Excel database formulae so that the analysis encompasses the new data? Chris discusses three possible approaches and highlights his preferred option.

What did you make of the Excel database formulae for beginners series? Have you managed to get the formulae working yourself? Share your experience with the Tiger community on the platforms below:

For regular spreadsheet hints and tips and more on the #ExcelRevolution:
https://www.facebook.com/TigerSpreadsheetSolutions

Contact us here.

Posted in Advanced Articles, Excel Guidance Articles, Excel Guidance Videos & Articles, Intermediate Articles, Uncategorized | Comments closed

Spreadsheet Skunkworks! Excel VBA Chess Challenge

Can we create a chess computer in an Excel spreadsheet using Excel VBA?

Welcome to the Spreadsheet Skunkworks! In this video series, Chris tests the boundaries of what is possible in Excel. You will not find the usual step-by-step tuition here; the focus is on experimentation and creativity. Expect plenty of coding challenges, and some nice surprises about what is possible in Excel…

Skunk Snap

We will seek to use Excel’s functions and Excel VBA to create the functions of a chess computer. We do not know to what extent this is possible but, ultimately, we would like to challenge somebody to a game on Chess.com using our spreadsheet-based system. Along the way, we aim to learn lots about Excel VBA and its capabilities.

Some key questions:
– How can we represent a chess board and chess pieces in Excel?
– Can we make Excel understand where the pieces can move?
– Can we ‘teach’ Excel some simple chess principles (capture the other pieces, move your pieces to good squares), and get Excel to recommend a move to make?

What do you think about the Spreadsheet Skunkworks series? Do you have any ideas for the Chris? Don’t forget to leave a comment on YouTube.

New videos in the series will be added to this post.

Click here to go directly to the Spreadsheet Skunkworks playlist on the YouTube channel.

Video 1 – Use Excel VBA to create a chessboard effect in an Excel spreadsheet

Click here to download the completed file used in the video.

In the first video, the challenge is to create a visual ‘chessboard’ effect in Excel. Chris first looks at how to do this ‘manually’ and presents some time-saving tips. Then, we explore how to use Excel VBA to speed up what could be a time-consuming task. Chris first records some code to format a cell and employs a ‘loop within a loop’ to colour the 64 squares of the chessboard. Some VBA techniques on show include ‘do – until’ loops and conditional statements. Enjoy!

Video 2 – Use a ‘remote referencing’ approach to create a chessboard effect, and allow user control of square formats

Click here to download the completed file used in the video.

In the second video in the series, Chris improves code produced in the first. We explore how to implement a ‘remote referencing’ approach to creating the chess board which achieves efficiency improvements. We also build in a mechanism to allow the user to control the appearance of the squares, and look at some cool cell fill options. VBA techniques in the video include for / next loops, loop within a loop, integer and boolean variables, and copy / paste (special) coding. Finally, Chris introduces his new puppy, Kuda!

Video 3 – Use VBA to select a range of cells

Click here to download the completed file used in the video.

In the third video in the series, Chris deals with the topic of selecting a range of cells using VBA. This requires some intricate coding but, once the technique is mastered, its applications are powerful. Chris refers to the technique as the ‘range, range, range!’ technique because three components are required – Range(Range 1, Range 2); range 1 refers to the top left-corner of the range to be selected, and range 2 to the bottom-right – with all cells between the two ranges being selected. See how Chris applies this technique in the video to quickly change the formatting of the number / letter references for the chess board. Chris also discusses how to best represent the chess pieces in Excel – using cells, or shapes?

Video 4 – For Next Loop, Offset and Variables to create and position pieces

Click here to download the completed file used in the video.

We currently have a chess board, but no pieces! In the fourth video in the series, we explore how to create the ‘pieces’, and position them accurately. It would be possible to do this ‘manually’ using shapes and dragging them around the board; but, it would be better to automate this process with a ‘reset’ button, to set the pieces up for a new game.

What coding techniques are required to get this job done? Chess comprises 32 pieces in total, so we’ll use a loop, combined with a table in the spreadsheet, to repeat the ‘positioning’ process while changing important details for each piece. Some Tiger favourites are on show here, including the offset command and integer variables. We’ll also create a ‘backend’ sheet to hold information that the user does not need to see.

Video 5 – The Power of Loops

Click here to download the completed file used in the video.

You could say that the last video was heavy in terms of coding, and light in terms of what we achieved in a practical sense. But, this is typical of most coding tasks: intensive programming is required at the beginning to set up the various mechanisms but, once the foundation is in place, we can quickly ‘scale up’ the code to get jobs done quickly. This is why Chris describes coding tasks as ‘front-loaded’.

In the fifth video, we firm up the foundation and then ‘scale up’ the code by populating a table in the backend, and adjusting the loop control to iterate through the code multiple times. This allows us to generate a row of pawns, positioned precisely on the board. What facilitates this awesome click-of-a-button functionality? We are witnessing the power of loops…

Chris also talks about the important ‘subset’ of skills in Excel VBA that create disproportionate value for the programmer. There is so much to learn in VBA, and in Excel more generally. Chris argues in the video that a small number of techniques, combined together, is all that is needed to create awesome Excel applications. What are some of the main components of this ‘subset’? If you follow Tiger’s videos, you will know that loops, variables and offset feature prominently.

Video 6 – Organising Code and Harnessing a Loop

Click here to download the completed file used in the video.

The next video starts with the ‘dry’ topic of code organisation in the VBA editor. Code is usually organised into ‘modules’ in the VBA editor; well-organised consists of routines (‘macros’) that are grouped by theme, and located in named modules. Moreover, as the name of a routine should describe its function, the name of a module should give us a clue about what the routines inside it do. As more routines are created, it is important to periodically step and back and tidy things up. Yes, things might be understandable to you, but would a colleague or a customer be able to make sense of things? What about you in six months’ time?! A professional coder allocates time to keeping things neat-and-tidy, and understands that, in the long run, this approach is more time-efficient anyway.

Now, the exciting stuff! In this video, Chris creates the starting position for a chess game, which consists of 32 pieces positioned on the correct squares. This task sounds onerous but, by harnessing the loop created in the previous video, we can get it done ‘at the click of a button’. The key mechanism is the interaction between the visual basic editor and a table on the ‘Engine’ sheet in the Excel file. It is easy to type information into the table; looping through a set of instructions 32 times, the VBA editor takes this information and, via a set of variables, uses it to position objects on the spreadsheet. The video shows how, with the basic ‘for-next loop’ mechanism established, things can be ‘scaled up’ very quickly to get a mind-boggling amount of work done.

As a bonus, Chris shows how to use text formulae such as =RIGHT, =LEFT and =LEN to quickly manipulate text, and avoid excessive typing.

Now, we’re almost ready for a game of chess!

What do you make of the spreadsheet skunkworks series? Any questions about Excel VBA? We would love to hear from you. Contact us here.

Posted in Advanced Articles, Excel Guidance Articles, Excel Guidance Videos & Articles, Intermediate Articles, Uncategorized | Comments closed

Excel Userforms for Beginners

Use Excel VBA to Create an Excel Userform and Manage a Database!

Click here to download the STARTER example file used in the videos.
Click here to download the COMPLETED example file used in the videos.

Video 1 – Introduction

In the first ‘in-car’ video, Chris explains how Excel userforms can help with a typical Excel task – managing a database. This can be time-consuming and frustrating and, correctly implemented, Excel userforms can help! We briefly discuss the importance of two functions – adding new entries to a database, and editing existing ones, consider how an Excel userform might help, and highlight the pivotal role of VBA code. Why not download the completed Excel file to ‘get a feel’ for the topic? Then, download the starter file so you are ready to work along with Chris
Why are Excel userforms important and what are some applications?

Video 2 – Create a Userform, Add a ‘Control’

This video looks at creating a Excel userform in the VBA editor and adding a simple feature or ‘control’. We add a command button and assign some code to the button. In the future, the user will click on this button to transfer data from the userform to the database. We make the command button flash up a message box so that we can understand how the Excel userform, command button, VBA and message box are interacting. This is a simple example, but all userforms follow a similar basic process to get things done.

Video 3 – Build up a Userform, Add Labels, TextBoxes, ComboBoxes

In this video, we build up a userform to so that it can quickly collect data from the user. We look at three controls, and focus on two ways of gathering data – TextBoxes and ComboBoxes. Textboxes allow the user to make a ‘free text’ entry, whereas ComboBoxes require the user to choose from a menu. ComboBoxes must reference a list in the spreadsheet, and we look at how to get the VBA editor and spreadsheet to interact to achieve this. We also explore how to implement option buttons – another interactive and user-friendly Excel userform feature.

Video 4 – Maximise User-Friendliness

A userform that is not working well can be more of a hindrance than a help! In the fourth video in the series, we look at maximising user-friendliness to make the user experience as smooth as possible. We explore how to configure the TabIndex property in the VBA editor to allow the user to navigate the userform using the Tab key on the keyboard. We also look at how to make default values appear in the controls to speed things up for the user, in addition to some other important details that help create a ‘professional’ feel.

Video 5 – Link the userform to the spreadsheet using Excel VBA

This task involves multiple ‘objects’ – the workbook, the worksheet and the userform, among others. VBA is essential to make these objects interact effectively – it is the glue that binds the various elements together. In this video, we consider how to approach what can appear a complicated coding task. We identify a sensible and simple first step that transfers data from the userform to the spreadsheet, and implement it using VBA. Dealing with the option buttons, however, requires a more sophisticated coding concept, can you guess what?

Video 6 – Position data precisely in the database using Excel VBA

So far, we have used VBA to move data from the Excel userform to the database. However, we need a way to tell Excel exactly where to put the data in the database. If adding a new entry, we would want the data to appear at the bottom of the database, for example. In this video, we explore how to set up a mechanism to measure the size of the database and to convey this information to the VBA editor. The mechanism is ‘dynamic’ in the sense that it responds to changes in the size of the database. It’s a great example of a common theme in VBA – getting spreadsheet formulae and VBA commands working together to achieve powerful and precise control.

Video 7 – Control and Helpful User Interaction

This video is a break from the complex coding! We take a detour through two topics that are often ignored but which are critical if you want to take your spreadsheet to ‘professional’ level. We deal first with the topic of control. We can achieve good levels of control by using validation to check user inputs. In the video, we look at setting up a ‘custom’ validation control to check if a proposed name is already in the spreadsheet, or not. The second topic is user interaction. It is not always clear what has happened when a VBA routine has run and it is a good idea to let the user know. How can we make this happen in the Excel userform task?

Video 8 – Use an Excel Userform to Edit Existing Data

The ability to edit (rather than add a new) entry is an important function that presents a new challenge to the programmer. In this video, we consider the task and identify the main steps. We look at how to create a new, simple userform to allow the user to highlight the entry to be edited. We use an offset formula in the spreadsheet to define a ‘dynamic’ range that changes size according to the number of entries in the spreadsheet. Then, we create a mechanism to establish the row that the ‘target’ entry to be edited is on.

Video 9 – Load Data from a Database into an Excel Userform

In this video, we explore how to extract data from the database and to load it into an Excel userform. Note that our approach is NOT to create two separate userforms – one for data input, and one for editing, which would represent a duplication of effort; rather, we use the original userform and attempt to establish two ‘modes’ – one for new entry input, and the other for editing existing entries. We look at how to create a sophisticated position control mechanism to retrieve data from the database accurately, and to display it in the Excel userform. This sounds like a big job, but ‘recycling’ code that we know already works can help!

Video 10 – Creating a Sense of Mode – ‘Add New’ and ‘Edit Existing’

In the final video, we explore how to create the sense of ‘mode’ that we refer to above. This is an intricate task that involves ‘saving’ some information for use in subsequent VBA routines. We look at how to combine a worksheet, the Excel userform and the VBA editor to make this happen. The result is a powerful, interactive and robust Excel userform that allows the user to quickly add data to and edit a large database.

Note: Chris did do some ‘tidying up’ of the code after shooting, to improve the quality of the completed file. This involved improving the in-code annotations and the structure of the code. No new coding ideas were introduced, however, and the mechanisms all work in the same way. Don’t feel that you should copy every detail of Chris’ approach, however; you now have the tools to design and implement your own powerful Excel userform-based applications. Good luck!

For regular spreadsheet hints and tips and more on the #ExcelRevolution:
https://www.facebook.com/TigerSpreadsheetSolutions
https://twitter.com/TigSpreadsheets
http://tigerspreadsheetsolutions.co.uk

How did you get on with the video series? Were you able to apply the technique in your work? Contact us here.

Posted in Advanced Articles, Excel Guidance Articles, Excel Guidance Videos & Articles, Intermediate Articles, Uncategorized | Comments closed

Use Excel VBA to Create Spin Buttons – Really Precisely!

Use Excel VBA to Create Spin Buttons!

Click here to download the STARTER example file used in the videos.
Click here to download the COMPLETED example file used in the videos.

Spin buttons are another great feature of Excel. Spin buttons speed up the process of data input by allowing us to change the value of a cell with a single button click. Cool! Correctly implemented, they can be a great time-saving feature. But, implementation can be problematic … If you have multiple rows in your spreadsheet, it can be time-consuming to creating lots of buttons. Moreover, getting them to line up neatly can be onerous. With some simple VBA coding, however, you can speed up this task and get it done with maximum precision. Welcome to the Use Excel VBA to Create Spin Buttons video series!

Video 1

In the first video, Chris demonstrates how to create a button, and how to link the button to a cell. It is important to ‘snap’ the button to the gridlines (use the Alt key on a PC) and to ensure that row heights are consistent – this will help create a neat and tidy look.

Video 2

In the second video, we look at how to use Excel VBA to create additional spin buttons. This may sound intimidating, but a basic routine like this is actually fairly easy to create. We use the macro recorder to record and examine some VBA code, then we make some tweaks to get it working for us. Finally, we add an instruction to the Excel VBA to ensure the buttons are positioned with maximum precision.

Video 3

In the third video, we explore how to ‘scale up’ the code. Some VBA to create a single button is great, but what if we want to create multiple buttons? This involves a powerful coding concept known as a ‘loop’. A loop works through a set of instructions a certain number of times, and is exactly what we need to create and position multiple buttons. Check it out!

Video 4

A spin button only works if it is linked to a cell – the cell that changes when the spin button is clicked. Clearly, however, we do not want to click through all of the spin buttons to manually link each to a cell. This would not be in the spirit of the video series! Can we achieve this using VBA instead? Find out in the last installment of the Use Excel VBA to Create Spin Buttons video series!

Was this video series helpful for you? What have you used spin buttons for? Do you have any feedback on the video series? We’d love to hear from you. Get in touch with Tiger using the platforms below!

For regular spreadsheet hints and tips and more on the #ExcelRevolution:
https://www.facebook.com/TigerSpreadsheetSolutions
https://twitter.com/TigSpreadsheets
http://tigerspreadsheetsolutions.co.uk

Posted in Advanced Articles, Excel Guidance Articles, Excel Guidance Videos & Articles, Intermediate Articles, Uncategorized | Comments closed

Use Excel VBA to Create Buttons For Super Fast Data Input!

How can we use Excel VBA to create buttons for super-fast data input?

Click here to download the example file used in the videos.

Any Excel user spends a lot of time doing data input. So why don’t we talk about it more? More efficient data input could save us a lot of time … and frustration!

What are the basic data input options? The first and most commonly used option is to simply type data in. This is what you did when you first used Excel, and you still do it now … a lot! It can mean annoying mouse / keyboard work, and time and effort to fix spelling mistakes, and other errors. Are they any better options?

Video 1 – Introduction

A dropdown menu is a good idea. With a single mouse click we can view possible inputs and select one. It is certainly an improvement on keyboard inputs, but still requires some fairly precise movements to manipulate the dropdown menu, which creates cognitive load, or ‘stress’! In a work situation it could be a distraction from your job.

At this point, let’s consider a real-life example. A classroom teacher would want to record student attendance, and might wish to use Excel or another piece of software to do this. This is where the benefits of super-fast data input come into sharp focus. The classroom teacher has a million things to think about: starting the lesson, student queries, have the students done their homework? In this situation, multiple mouse clicks and keyboard work is frustrating; indeed, it might mean that the teacher gives up on the Excel file altogether!

Super Fast Snap

We can use Excel VBA to create buttons for super-fast data input. This means that, rather than clicking around or using the keyboard, the teacher can make a single button click to input the required data. Moreover, mistakes can be quickly rectified by clicking the same button. With this level of usability, super-fast data input can make this kind of Excel-based tool a real asset to the classroom teacher.

How does it work? Well, multiple buttons are required. Anybody who has tried to create and manipulate multiple buttons in Excel knows that this can be onerous! There is nothing worse than copy / pasting and manually lining up shapes. With some basic coding ideas, however, we can dramatically speed up – and de-stress – the process. Watch the video series, work along in the download file, and learn the practical skills. Welcome to Excel VBA Beginners – Create Buttons for Super-Fast Data input!

Video 2

Video 3

Video 4

Video 5

Video 6

Video 7

Video 8

How did you get on with the video series? Were you able to apply the technique in your work? Contact us here.

Ever thought about how to cleanse a dataset using computer coding in Excel?

Read more about the #ExcelRevolution here. Or, follow us on Facebook and Twitter.

Posted in Advanced Articles, Excel Guidance Articles, Excel Guidance Videos & Articles, Intermediate Articles, Uncategorized | Comments closed

How to Collate Sports Fixtures Results into a League Table in Excel

INTRODUCTION

How can you collate sports fixtures or results into a league table in Excel?

Click here to download the STARTER file.
Click here to download the COMPLETE file.

Sport enthusiasts might wish to create a league table from a set of results in Excel, but it can be difficult to know how to start. Without good pivot table or VBA programming skills, it is a complex task that cannot be completed in one fell swoop. It necessitates some clear, logical thinking about the required steps, and the creation of a well-structured Excel file.

Video 1 – INTRODUCTION

In the introductory video, Chris talks about the task, why it can be difficult to create a league table in Excel, and the best mindset to adopt.

The video series invites us to reflect on what a well-structured Excel file looks like. We propose a structure comprising three elements – a backend, calculations and frontend – and apply it in the video series. This is a good general structure to apply to your next Excel-based task!

Along the way, we apply Excel formulae that are essential in spreadsheet modelling including if, sumif, offset, match and vlookup.

As a starting point, Chris takes the results data from the 2015-16 Premier League season and works through the steps towards a league table. In the final video in the series, Chris tests the model created against the actual Premier League table. Will it be accurate?

Excel Sports Results

Video 2 – convert scores to a result using if

Video 3 – collate wins and losses using countif 1

Video 4 – collate wins and losses using countif 2

Video 5 – use sumif to find goal difference

Video 6 – use match and offset to create the league table


How did you get on with the video series? Were you able to collate the sports results into a league table in Excel? Contact us here.

Ever thought about getting started with computer coding in Excel?

Read more about the #ExcelRevolution here. Or, follow us on Facebook and Twitter.

Posted in Advanced Articles, Excel Guidance Articles, Excel Guidance Videos & Articles, Intermediate Articles, Uncategorized | Comments closed

Excel Custom Navigation: Excel VBA for Beginners

INTRODUCTION

What is an Excel custom navigation system? Switching between sheets, unless using keyboard shortcuts, means moving the mouse pointer all the way to the bottom of the screen. With multiple sheets and workbooks, this can be onerous – is there a better way?

Click here to download the STARTER file.
Click here to download the COMPLETE file.

Video 1 – INTRODUCTION

Watch Chris describe what the Excel custom navigation system is, why it helps, and how to create it.

The Excel custom navigation system is a neat alternative. It positions navigation buttons at the top of the worksheet, not at the bottom, facilitating smooth navigation. It also creates a distinctive visual effect, similar to a ‘cockpit’ or car dashboard, which gives the spreadsheet a professional look.

But, from the learning perspective, there is something more important. Building a custom navigation systems presents an opportunity to learn new coding techniques. Clearly, we do no want to have to create and position all the buttons manually! So, what coding techniques will allow us to do it quickly, precisely and minimise stress?

Excel Custom Navi

The Excel custom navigation system video series takes you through the main steps. We explore how to create multiple buttons, how to position them, how to trigger the right code, and how to copy them across sheets. Some of the code is quite intricate – you can see Chris get into a coding tangle, and work his way out!

Video 2 – Create a shape and duplicate it using VBA

Video 3 – Use VBA to position shapes

Video 4 – Use VBA to control text that appears in shapes

Video 5 – Use VBA to navigate to a sheet dynamically

Video 6 – Use VBA to copy / paste shapes across sheets


Why not try creating your own Excel custom navigation system? Let us know how you get on!

Read more about the #ExcelRevolution here. Or, follow us on Facebook and Twitter.

Posted in Beginner Articles, Excel Guidance Articles, Excel Guidance Videos & Articles, Intermediate Articles, Uncategorized | Comments closed

Excel Game – Do You Know the Offside Rule?!

INTRODUCTION

How can you get better at Excel? Creating an Excel game is a great way to explore Excel’s capabilities away from the pressures of work or study. We hope that our Excel game inspires you to try to create your own! The game works for PC (but not Mac); it will not work in Google docs or Open Office. If you have Excel, Simply save the file to your desktop, open it, and get started!

Click here to download the file.

Excel Game Shot 1

WHAT IS THE GAME?

Our Excel game is called Euro 2016 Linesman. A linesman’s role in football or ‘soccer’ is to indicate if a player is offside. Simply put, a player is ‘offside’ if there are fewer than two players between him or her and the goal, when the ball is played.

In our game, you have to make a number of offside decisions from a ‘bird’s eye’ view of the pitch. Decisions are assessed in terms of accuracy and time. If your decision-making is good enough, the assessor will promote you to a higher league. The aim is to reach the Euro 2016 tournament at the end of the season, but you only have 11 months – and you can be demoted as well as promoted! There is at least one surprise along the way…

Excel Game Shot 2

Why not download it and try it out? Simply save the file to your desktop, open it, and get started! Will your friends be able to beat your scores?

Click here to download the file.

HOW DOES IT WORK?

The Excel game file is not protected, and you can explore it to understand how it works. Simply right-click on the sheet tab at the bottom to unhide the hidden sheet.

The Excel game combines together formulae and Excel VBA code to create the required functionality. The shapes are randomly positioned within certain parameters using random numbers. Using VBA, a table on the background sheet is populated with the positions of each of the ‘players’; formulae then compare the positions, and establish if players are offside or not.

Excel Game Shot 3

The file uses formulae and VBA to note the time that decision-making starts, and ends. This gives a time for each decision. Right and wrong decisions are tracked from one routine to the next using module-level variables. User interaction takes place through dialogue boxes – simple message boxes, and ‘yes / no’ message boxes. All of these elements combine together to create the gameplay.

WHY IS THIS IMPORTANT?

Exploring an Excel game is a great way to improve your Excel skills away from the pressures of work or study. This kind of creative application pushes our imagination and skill level, which can only benefit our day-to-day work. The Excel game is also a great example of a complete Excel application: more important than understanding the formulae and VBA code is to understand how the whole thing works. When you learn to combine different elements (formulae, code, user interface, backend) together, you can create powerful Excel applications.

We hope you enjoyed the Excel game! Do you have a specific question about how it works? Why not leave a comment on the video on the YouTube channel, and share the file with your colleagues.

Ever thought about getting started with computer coding in Excel?

Read more about the #ExcelRevolution here. Or, follow us on Facebook and Twitter.

Posted in Advanced Articles, Beginner Articles, Excel Guidance Articles, Excel Guidance Videos & Articles, Intermediate Articles, Uncategorized | Comments closed

Rich Picturing: Six Tips for Getting Started

This article tells you what rich picturing is, why it is important, and how to do it. It provides six tips for getting started, and two example rich pictures based on cases in the business press. If you’re not in a reading mood, you can simply watch the video below!

What is Rich Picturing, and Why Is It Important?

Analysts and managers in organisations tend to talk or write about situations. You probably write many emails and attend many meetings every day! It is the accepted way of doing things.

The problem is that there are limitations to the spoken and written word. Neither helps us to view situations holistically, or express dynamic relationships well. It can limit our understanding. If a situation is not well understood, it is difficult to take purposeful action, which leads to stagnation, or failure. There are plenty of recent examples of failed strategic initiatives to support this idea.

In the 21st century, markets can be transformed, redefined, or made irrelevant very quickly. Our business environment has changed; but, we generally use the conventional medium to understand it. We think we need alternative ways to process this new, complex environment, and to appreciate the opportunities and threats it presents. We question whether the conventional approach is always fit-for-purpose! What are the alternatives?

Rich picturing is a richer and more challenging medium that presents new possibilities for analysts and managers. It refers to the practice of representing a problem situation visually. You could say that it is drawing out your situation on paper. It can be done individually, or in groups.

Rich Picturing Still 1

Usage for Analysts, Managers and Consultants

For an analyst, rich picturing offers new possibilities. In your day-to-day work, you would typically receive a briefing from your manager, some data, and would be expected to build a model to ‘solve’ a problem. Rarely, however, are you asked to explain ‘why’ a model is important; but, perhaps you have doubted the utility of some of the models that you have been asked to build. Rich picturing allows you to look at the situation in its entirety, and to choose the best place to focus your modelling efforts. It’s a great way maximise the impact of your modelling skills.

For a manager, rich picturing can be an awesome strategic tool. Rich picturing allows you to view the different areas of a problem situation at the same time. Using the structure outlined below, you can capture the firm-, industry-, and environment-level factors in a single view. This engenders a more holistic understanding of the situation, and a stronger appreciation of the linkages between the various elements. It provides you with an excellent starting point for strategic thinking.

For a consultant, rich picturing can facilitate a first client meeting. Whether you are consulting internally or externally, there is a need to ‘talk through’ the situation and to air all of the issues. Your client will no doubt have an idea what the root causes of their problems are, but it is your job to provide constructive challenge, and offer alternative hypotheses. In an individual, group or one-to-one setting, rich picturing can be a useful addition to your consulting toolkit.

For everybody, rich picturing offers a creative way to think about business problems. Research suggests that pictures are more memorable than words, and people usually think it is fun putting one together. So, how do you get started with it?

Rich Picturing Still 2

Some Tips to Help You Get Started!

Now, if you are thinking ‘I won’t be able to do that, because I can’t draw!’ you are not the only one. But, as we will find out, your artistic ability or inclination does not really matter!

The purpose of these resources is to share some basic guidelines that anybody can apply to help them get started with rich picturing.

So, let’s look at some helpful tips.

The number one rule of rich picturing is ‘It’s not about the picture!’ We are not suggesting that you should show your picture to your client or manager; but we are suggesting that creating a rich picture will help you view a problematic situation differently, and generate new insights. You have to adopt an entirely different mindset to create a rich picture, and this is where the value actually lies. The presentational quality is less important.

Number two is to use a structure to help you get started, and to identify the levels relevant to your problem situation. Use three levels and divide the paper into three to represent these. We recommend using the levels of firm, industry, and broader environment. Other possible levels are the individual, the team, the department or division, or a group of competitors. There are many possibilities; the point is that the picture helps you think about the different levels and captures the relationships between them.

Rich Picturing Structure Graphic

Number three is to create an issues list. It is important to diagnose your organisational situation – to identify all of the things that are going wrong! So, when you identify something that is problematic, contentious or uncertain, write it down. Try to be articulate: writing ‘marketing’, for example, is not really helpful; but, writing ‘difficult to identify target market’ is more precise and therefore useful. The list of issues is the main output of the rich picturing process. You can position it on the right of the picture, as illustrated in the graphic above.

You may not want to share your rich picture for whatever reason, but the issues list identifies all of the insights that you gained, in text form. It should guide your next steps: deciding where to take action in the problem situation, and the best modelling approach.

Number four is to decide on the focus. The focus should be your client or customer. Of course, your client or customer could be yourself, if you are using the picture for your own purposes. Draw your client or customer in first, usually it is best to position him or her just inside the organisation part of the picture.

Number five is to focus on relationships. It is important to make the picture as rich as possible – you should not be ‘filtering out’ many of the details yourself. However, it is equally important to link the various elements together. As an analyst or a manager, it is helpful to understand how long-term trends shape the dynamics of the industry, and the firm’s position in relation to its competitors. You must focus on the interactions between the parts of the picture to do these things. Use dotted lines to indicate a link, and an arrow to convey a clear causal relationship.

Rich Picturing Still 4

The final guideline is to create an icon set. As you do more rich picturing, you will find yourself using the same symbols or icons repeatedly. Get used to drawing common features such as people and other competitors, and develop quick ways to draw them. If you can quickly draw out the important elements, it will improve the efficiency of the process. So go on, create your own icon set!

There are six basic guidelines to help you get started. We hope you realise that it is nothing to be scared of, and we hope this motivates you to try it out for yourself! Now, time to practise…

Exercises
Use the below cases and rich picture examples to help you get started. Access the article, read it and, with the six tips in mind, create your own rich picture for the organisational situation. Then, compare to the examples provided.

It is important to bear in mind that there is no ‘model’ rich picture for any situation – everybody’s interpretation is different. However, comparison with the examples may help you check how well you have applied the principles outlined above. It is important to also reflect on how rich picturing made you think about the situation. What insight, if any, have you gained that you would not have gained from a bullet point analysis?

Exercise One – Hugo Boss
Link to article
PDF of example rich picture

Exercise Two – Morrisons Supermarket
Link to article
PDF of example rich picture

HOW DID YOU GET ON? LET US KNOW!

We hope you’ve found these videos helpful, and thar you have tried rich picturing for yourself. How did you find it? Let us know! Contact us here.

Do you want to see more of this type of content? Content focused on ‘soft’ business analysis techniques, as opposed to spreadsheet tutorials.

Ever thought about getting started with computer coding in Excel?

Read more about the #ExcelRevolution here. Or, follow us on Facebook and Twitter.

Posted in Excel Guidance Articles, Excel Guidance Videos & Articles, Uncategorized | Comments closed