Playback starts YouTube’s embedded player (privacy-enhanced mode).
How to Use Excel VBA Code - Real Example P3
ChannelTiger Spreadsheet SolutionsDescription from the creator
Download File Link:
tinyurl.com/y4d6ds62
----------------------------------------------------------------
In the third video, we first implement a 'loop within a loop' - the powerful mechanism that allows us to get the first part of this job done. Conceptual thinking always comes first, so what exactly are we trying to do, and can we explain it clearly in normal language? Let's try...
We already have one loop set up which loops through the worksheets in the file. The next loop, which operates 'one level down' and is embedded within the first, will loop through the name cells on each sheet. With the conceptual understanding clear, we can move onto the programming.
Chris uses a 'for each object in the collection' / 'for - each' loop to work through the name cells on each sheet. This type of loop could be applied to open workbooks, shapes on a sheet, sheets in a file, or another of Excel's 'collections' of objects. It shows how, if we can navigate Excel's object hierarchy, we can make coding easier.
In this case we loop through each cell in the range of cells that contains customer names, as defined by the dynamic range reference we created in the previous video. We test the mechanism using message boxes to extract information from the VBA editor during code execution. Job done - next!
The next step is to understand if a particular name appears in the list of names we are assembling. Remember, Eric has requested a list of 'unique' names, so names must not be duplicated. So, how can we check if a name already appears in the list? We set up a thing of beauty: worksheet formulae working together with Excel VBA to get a job done. In this case we create a 'COUNTIF' formula to establish if a value appears in a range; if the formula returns a value of zero, we know the name needs to be added to the list.
Onwards!
See you in part 4. Don't forget to let us know in the comments how you get on, Chris will get back to you.
Series Playlist Link:
tinyurl.com/y4pmrkxn
🎁YOUR EXCEL CHEATSHEET
🎁1 Page Summary Of What You Need To Know
tinyurl.com/yc7jlmbs
facebook.com/TigerSpreadsheetSolutions
twitter.com/TigSpreadsheets
Also on Insta :-)
About this tutorial
Tiger Spreadsheet Solutions published this 9:55 video tutorial on October 25, 2019. It has been watched 5,789 times on YouTube.
- Channel
- Tiger Spreadsheet Solutions
- Category
- Education
- Duration
- 9:55
- Published
- October 25, 2019
- Views
- 5,789
- Likes
- 86
Tags
Share
Further reading
-
Getting started with VBA in Office | Microsoft Docs
docs.microsoft.com
The VBA code in this article runs against an open Office application where many of the objects that the code manipulates are already up and running; for example, the Application itself, the Worksheet in Excel, the Docum…
-
VBA Code Examples for Excel - Automate Excel
automateexcel.com
To write VBA code in Excel open up the VBA Editor (ALT + F11). Type "Sub HelloWorld", Press Enter, and you've created a Macro! OR Copy and paste one of the procedures listed on this page into the code window.
-
VBA Examples | List of Top 19 Excel VBA Examples for Beginners
wallstreetmojo.com
Excel VBA Examples for Beginners. Macros are your best friend when it comes to increase your productivity or save some time at your workplace. Right from small tasks to big tasks, we can automate by using the VBA coding…
This tutorial in other languages
- FRComment utiliser Excel VBA Code - réel Exemple P3
- ESCómo utilizar código VBA Excel - Ejemplo real P3
- PTComo usar o código VBA no Excel - Exemplo real P3
- ITCome utilizzare il codice VBA di Excel - Esempio reale P3
- DEWie zu verwenden Excel-VBA-Code - Real Beispiel P3
- NLHoe te gebruiken Excel VBA Code - Real Voorbeeld P3
- RUКак использовать Excel VBA кодекс - реальный пример P3
- PLJak korzystać z programu Excel kodu VBA - prawdziwy przykład P3
- JAどのようにExcelを使用VBAコードに - 実際の例P3
- ARكيفية استخدام Excel كود VBA - ريال مثال P3
- HIकैसे Excel का उपयोग करें VBA कोड के लिए - रियल उदाहरण पी 3
- IDCara Gunakan Excel VBA Kode - Nyata Contoh P3