Learning VBA at a late age

TheCman81

Well-known Member
Joined
Feb 28, 2012
Messages
535
Hi All,

When it comes to front end Excel, spreadsheets, formulas etc I'm very competent and have alot of experienece! However I've just started to look at learning VBA Programming because it fasinates me so much!

I'm 31 years of age and what I would like to know, someone of my age, is it possible to learn VBA Programming and become a very competent user or does it take a certain mindset?
 
Phil GS,

Thanks for the feedback.

You are very welcome. Glad I could help.

Come back anytime.


The day I give up on challenges and pick up the knitting

My wife is a knitting machine, and has one. What amazing things she creates.... It keeps her out of trouble most of the time.

When you stop, it's all over. :LOL::LOL::LOL:
 
Upvote 0

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Hey,

Just from my experience I would say read these books to get a basic idea of the following:

-types of variables
-Basic syntax, control flow and loops, subs, functions, enumeration etc
-Number system that Excel uses, a lot of subtle problems can be caused by floating point operations
-Object hierarchy (Application.Workbook.Worksheet), a basic idea of what objects are out there (ranges, worksheets, charts, workbooks etc)

After that I think it is best to just try and solve a bunch of simple problems, which the format makes easy and very visual. Generally it is helpful to build up a little function library to supplement the built in VBA functions. Probably a better list out there but here are some of the most basic:

Easy Fun Stuff:
-Make a bunch of cells colourful (not too many), try to make circles, triangles and squares (try to make them move!)
-Zoom your spreadsheet out all the way, square up your cells and use each cell as a "pixel" to do this
This helps with notation, and figuring out how best to address ranges.

Range Functions:
-Last/First Row/Column: The classic one line method LastRow=cells(rows.Count,2).end(xlup).row has a few problems
-Real Used Range: the built in used range is poor, so you can look at why its poor and how to make it better
-Try coding your own Intersect function and compare to the actual function
-Lots of the built in functions do not handle multiple area ranges well, try "fixing them" for instance a function that counts all the rows (or unique rows) in a multiple area range
-Function that returns the "first" (leftmost, topmost) or "last" (bottommost, rightmost) area from a range

Array Functions:
-Unique values from a list: Try this out using the Dictionary object, it is a good introduction
-A function to check if two arrays have the same dimensions
-A function to check if two arrays are equal
-Element wise operations: Allow two arrays to be compared element by element, should input like (Array, Value, Operator ("+,-,*,/")
-Number of elements in an array (include possibility of arrays of arrays or "jagged" arrays)
-Reverse an array "in place"
-Check if an element exists in an array: This has many possible solutions, some more efficient then others given certain types of array, look into "filter"

String Functions:
-Extend mid, left, right and instr to words. Ie have a WMID function that will produce output like WMID("the cat ate the dog",2,1)="cat ate"
-Have a word count function (one way of doing this would be to remove all duplicate spaces then count the spaces and add 1)
-Find the fastest way to delete duplicate spaces (for medium size strings there IS a better way than Application.trim)

Date Function:
-Code the "workday" function yourself
-Sometimes it is useful to get a date from a user so make a little form with some flexible constraints and robust error checking to make sure a valid date for your needs is entered

File Functions:
-Look into the FSO, and use it to code simple open, move, copy, and select functions for files/folders
-Write a function to check if a certain path exists

Regular Expressions:
-Familiarize yourself with some common and simple cases such as patterns for a wide range of telephone numbers (a classic example lots of solutions online)
-Use regex to write a function that removes certain characters from a range of cells

Solve all these sorts of problems, and when you are coding something, and run into a problem you expect to see again, take a minute to separate the problem, code it well and put it your function library. When you learn more, you can revisit these building blocks so to speak and improve them!
 
Upvote 0
Thanks chirp. I will take a look at your suggestions - all I have at the moment is the official Microsoft VBA user manual for Excel version 5.0, dated 1993 - shows my age and hoarding instincts. Starting to enjoy getting some things to work. All the best
 
Upvote 0
hi to all,

I guess learning has no barrier as long as you need to or want to. For me, I've been using Excel for almost 10 years now but just a year back I have realized its power. So my learning bug alway "bugging" me to know more about the application so that hopefully I can be more proficient at work.
 
Upvote 0
Hey Hiker95
Darn, if your that old, that archive library you've been building must be huge....and here I was thinking you was just a kid ( that means younger than 50 to me)
BTW, what are using to compile said library ??
I've looked at a few options, but seem to fall back on modules in excel !!!....either that, or my diminishing memory...hey that's why my golf handicap keeps going down....:ROFLMAO::ROFLMAO::ROFLMAO:
 
Upvote 0
Michael M,

BTW, what are using to compile said library ??

Excel workbooks - what else:LOL::LOL::LOL:

Helpful Macros Old.xls 4,043 rows.
Helpful Macros.xls 14,258 rows. Macros, extracting numbers/text from strings, my training list...
Text Files.xls
Sumproduct.xls
Arrays.xls
Text Files Excel 2007 Windows 8.xlsm
Index Match Examples - SDG13.xls
Index Match Examples - SDG15.xls
Scripting_Dictionary RegExp.xls 1,497 rows.
Scripting_Dictionary RegExp Pattern s Examples - SDG17.xls
CreateObject_scripting_dictionary Examples - SDG15.xls
Scripting_Dickionary Keys Items Methods - SDG17.xls
Scripting_Dickionary Keys Items Methods - SDG20.xlsm
MyPersonal_xlsb_BACKUP.xlsm
 
Upvote 0
Missed the really good ones:

that's why my golf handicap keeps going down

Me too :LOL::LOL::LOL:

And, my son got me started with Fly Fishing last year. I now have licenses for PA, NJ, and, NY.

Plus three wonderful children, their spouses, and, nine grandchildren, and, a grand puppy - an off white labradoodle.
 
Upvote 0
We're obviously not far apart ( age speaking) then, I'm the same, but only 3 grandkids....and no dog as yet, we haven't got around to replacing Mac.
We kinda still miss the little guy !!

Did I notice in one of your past posts, you had a website ??
I'd like to have a browse.....I always enjoy your posts and feedbacks.
BTW...I have updated the "List" to the latest and post it whenever needed....always with acknowledgement to your good self, of course !!!
 
Upvote 0
Michael M,

Did I notice in one of your past posts, you had a website ?? I'd like to have a browse.....

Not yet.


BTW...I have updated the "List" to the latest and post it whenever needed....always with acknowledgement to your good self, of course !!!

Thanks for that.


And, thanks for some of your macros. I have many in my archives.
 
Upvote 0
And, thanks for some of your macros.

pleasure....I generally stick to the simple stuff....my brain simply melts when I see stuff from the likes of Rick, PGC01, jindon, et al.
 
Upvote 0

Forum statistics

Threads
1,215,641
Messages
6,125,981
Members
449,276
Latest member
surendra75

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top