I often need to determine the ordinal indicator (st/nd/rd/th) associated with a number, especially when I am working with dates. In this post, we will learn to write a simple user defined function in VBA, which will identify the ordinal indicator of an integer. Since the logic is quite straightforward, let us see how we can use the different control structures available in VBA.
Archive for ‘User Defined Function’
Removing non-printing characters from text in Excel using VBA
Have you ever encountered a perfectly constructed MATCH or a VLOOKUP function failing for no apparent reason? Have you had […]
Is the WorksheetFunction property necessary in Excel VBA?
Excel’s Application object’s WorksheetFunction property is a container for Microsoft Excel worksheet function. This property returns a WorksheetFunction object that allows […]
Are you Sure? Get user’s consent before running a Macro in Excel VBA for Beginners
This post is about getting the user’s permission before running a procedure, using the MsgBox function.
Concatenate Unique Cells, with Text Formatting
A fellow struggler requested me to help him with a slightly beefed up Range Concatenate function. He needed to combine a […]
Clean a string for Range Names – Regular Expressions
I am a big fan of using named ranges in my VBA code. It makes referring to cells in formulas […]
Introduction to Regular Expressions in VBA
Regular-Expressions (RegExp) is something I bumped into when my string manipulation requirements jumped to an advanced level. Before I started using this […]
Reversing a string in Excel
In my many years of rummaging through the internet for help, I have seen countless posts where troubled help seekers […]
Concatenate Range and Retain Formatting
In one of my previous posts, I wrote a function to concatenate the values stored in all the cells of […]
An upgrade to the Text() function in Excel
Many of us are familiar with the Text() function. It comes in handy when you set up excel to draft […]