Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
550 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
We have 25 Excel VBA - Basics videos listed below.
Posted by Andrew Gould on 10 May 2013
Posted by Andrew Gould on 10 May 2013
Posted by Andrew Gould on 10 May 2013
Posted by Andrew Gould on 10 May 2013
Posted by Andrew Gould on 23 May 2013
Posted by Andrew Gould on 09 November 2013
Posted by Andrew Gould on 17 January 2014
Posted by Andrew Gould on 21 January 2014
Posted by Andrew Gould on 22 January 2014
Posted by Andrew Gould on 23 January 2014
Posted by Andrew Gould on 27 January 2014
Posted by Andrew Gould on 03 November 2014
Posted by Andrew Gould on 30 January 2014
Posted by Andrew Gould on 31 January 2014
Posted by Andrew Gould on 03 February 2014
Posted by Andrew Gould on 06 February 2014
Posted by Andrew Gould on 07 February 2014
Posted by Andrew Gould on 10 February 2014
Posted by Andrew Gould on 17 February 2014
Posted by Andrew Gould on 24 February 2014
Posted by Andrew Gould on 28 February 2014
Posted by Andrew Gould on 28 February 2014
Posted by Andrew Gould on 03 April 2021
Posted by Andrew Gould on 10 August 2021
Posted by Rick Gould on 29 July 2024
You might also like to consider booking a place on one of our online or classroom VBA courses, where you could meet the owls behind the videos!
From: | Nithpha |
When: | 17 Sep 19 at 18:15 |
Dear Wise Owl,
How can I use VBA to copy one specific sheet from each workbook which located from one path to current workbook?
The specific sheet will be named as the same as the name from each file in the current workbook.
Thanks in advance!
From: | Andy B |
When: | 19 Sep 19 at 09:08 |
We don't usually answer technical queries (we'd never get any of our training or blog/video development done otherwise), but I'll leave this question on her in case anyone else can answer ... ?
From: | duggie |
When: | 01 Aug 18 at 12:17 |
Hi,
In this video, you mentioned the singular is usually the object in the collection, eg worksheet is an object of the collection of worksheets (plural).
You mentioned usually.
What are the exceptions?
Thanks
From: | Andrew G |
When: | 03 Aug 18 at 08:41 |
The most notable one, I think, is Range. A range can be a single cell as well as a collection of other cells.
Using the For Each loop to process a range works differently. In most cases, to process a collection with a For Each loop, you declare a variable whose type is the singular object, e.g. Dim c As Chart. You then use the plural name of the collection in the loop, e.g. For Each c in Charts. The relationship holds true for most examples - Worksheet:Worksheets, Workbook:Workbooks, Shape:Shapes, PivotTable:PivotTables, etc.
To process a range with a For Each loop, you would use the singular object to declare the variable, e.g. Dim r As Range. You would not, however, use Ranges as the name of the collection. Instead, you must specify the range of cells you wish to loop over. This provides a large amount of flexibility, as many properties and methods return a reference to a range object. Any of the examples below are valid:
For Each r In Range("A1:A10")
For Each r In Range("A1").CurrentRegion
For Each r In ActiveSheet.Cells
For Each r In Selection
From: | duggie |
When: | 04 Aug 18 at 15:25 |
One thing I noticed from watching your collections video is this. Normally to loop over a collection, you define a variable of the same type as the collection. For example:
Dim ws as Worksheet
For Each ws In ThisWorkbook.Worksheets
Next ws
So assuming that's a "rule" I tried this, which obviously failed:
Dim MyColl As Collection
Dim MyCollElement As Collection
For Each MyCollElement In MyColl
Next MyCollElement
thinkg that since I'm looping over a collection (MyColl), I must define a variable of the same type, MyCollElement, as a Collection too!
From: | kwanizac |
When: | 07 Jun 18 at 01:04 |
Hi, I have created a custom ribbon and attached a macro to this item in excel. My question is how do I make this custom ribbon/button available on each end user's terminal? The macro-enabled document is located on a shared folder through which all users have equal access. However, the custom ribbon/button is not available to all users when opening the same workbook.
Can you kindly help or instruct accordingly please?
From: | Andrew G |
When: | 07 Jun 18 at 07:21 |
Hi, you can share your custom ribbon configuration with other users as described here.
I hope that helps!
From: | kwanizac |
When: | 07 Jun 18 at 15:03 |
Thanks for the quick response.
I am aware of the importation method but I was wondering if there was anything more versatile and dynamic. The end product would target many users on various terminals and it would be inefficient to have everyone import custom tools everytime a change, improvement or alteration is made .
Is it possible to have implicitly included in the code the ability to have real time updates for the custom toolbar or ribbon?
Thanks a lot for your help.
From: | Abishek S |
When: | 16 Nov 17 at 16:38 |
Hai Andrew G,
I just want to encrypt my VBA code. Apart from using password protection from tools menu, Is there any possible way to do that? If the user tries to open tne module then the code should be at an encrypted state. I do not think, using password is an effective way to protect my code because there is a way to break the password and to view the code.
From: | Andrew G |
When: | 16 Nov 17 at 19:14 |
Hi Abishek, there are commercial tools available such as http://www.lockxls.com/product.asp and https://www.ozgrid.com/excel-add-ins/encrypt-VBA.htm
I haven't used either of them so can't comment on their effectiveness.
I hope that helps!
From: | Abishek S |
When: | 15 Nov 17 at 10:26 |
Hai Andrew G,
Thankyou so much for your help. Is there any alternative ways to use firefox as a web browser in Excel VBA instead of IE. If any tutorial available for this case, kindly give me that link.
From: | Andrew G |
When: | 15 Nov 17 at 10:36 |
Hi Abishek, other than Selenium there's a commercial tool available here https://imacros.net/ but I haven't used it so don't know how useful it will be!
From: | Abishek S |
When: | 14 Nov 17 at 09:07 |
Hai Andrew G,
Firstly, I would like to thankyou for this woderfull playlist of ExcelVBA. I have a request for you. Is it possible to view the progress status of the ongoing Macro through a status window. It should show the status as percentage.
Thankyou
From: | Andrew G |
When: | 14 Nov 17 at 10:42 |
Hi Abishek,
The VBE doesn't have a feature like the one you've described. You could create your own progress indicator with a User Form and Progress Bar as shown in this video https://www.wiseowl.co.uk/videos/excelvbauserforms/progress-bar.htm
I hope that helps!
From: | Abishek S |
When: | 15 Nov 17 at 03:29 |
Hai Andrew G,
Thanks Andrew that helps.... Also i have a lot of doubts in using selenium for webpage scraping. Currently i have installed SeleniumBasic-2.0.9.0 in my Windows 10 device. for example
{sub Frfox()
Dim SLNM As New WebDriver
SLNM.Start "firefox", "http://www.google.com"
end sub}
The above code only opens a new firefox window but the URL is not getting loaded. Please help me with this issue.
From: | Andrew G |
When: | 15 Nov 17 at 08:22 |
Hi Abishek, I'm sorry but I don't have any experience with using Selenium so I can't help you with this.
From: | surjitpal123 |
When: | 15 Jun 17 at 01:36 |
Hi,
I have gone through your vba videos and they all were awesome. i have one request if you can create one more video that shows dynamic auto filter. .
Surjit
From: | Andrew G |
When: | 15 Jun 17 at 07:32 |
Hi Surjit,
I have a list of videos that I'd love to find the time to make - I'll add this one to it!
From: | Maux |
When: | 11 Mar 17 at 19:55 |
Hi!
First of all I would like to congratulate you for this incredible series of videos about VBA.
Through you, I have been able to improve and learn more and more my knowledge in Excel and VBA.
I would like to know if you are going to, or intend to release, any video about Regular Expressions (RegExp) for Excel / VBA?
It is a very interesting and very powerful subject for queries, validations, ect. But little used or demonstrated by the communities.
Again, thank you for the dedication and high quality of your teaching.
A hug from Brazil!
Maux :)
From: | Andrew G |
When: | 12 Mar 17 at 17:29 |
That's the second question on Regular Expressions I've had this week! The topic has been on my list for some time, I simply haven't had time to plan and create a video on the subject yet. Perhaps I should move this topic a little further up the list and aim to create something in the near future.
Thank you for the kind comments and for watching!
From: | phicks |
When: | 06 Dec 16 at 13:30 |
I have a workbook with 4 sheets. Three of these sheets have employees that are scheduled daily, the fourth is the actual schedule. What I would like to accomplish is when I schedule that person he or she is highlighted on the other sheets to help identify who we can and cannot use. I am fairly new to VBA, but extremely excited to learn something new. Thank you so much for you time and any assistance woould be greatly appreciated.
From: | Andy B |
When: | 06 Dec 16 at 18:02 |
The question is a bit vague, and I suspect this answer won't help much. What I'd do is follow through the videos or blogs on our website for now.
However, here's a macro to colour in all the cells in range A1:A3 which contain the name Bill. You could obviously modify this to work with any range and any name.
Sub ColourPeople()
Dim PersonCell As Range
Dim PersonRange As Range
'set a variable to refer to the range where people can be found
Set PersonRange = Range("A1:A3")
'colour in all the people with the right name
For Each PersonCell In PersonRange.Cells
If PersonCell.Value = "Bob" Then
PersonCell.Interior.Color = vbGreen
End If
Next PersonCell
End Sub
Exactly when and how you'd call this macro would depend on exactly what you were trying to achieve.
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.