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.
Tag Archive for ‘Excel VBA’
Remove Filters in an Excel Sheet using VBA
Has your data import procedure ever failed due to users applying filters to the data? This happens quite often, especially when you have to distribute multiple files, which you intend to stack later. Copying filtered data copies only works on the visible cells; and you end up loosing out the hidden rows if the user applied a filter before saving the file. Let us take a look at how to remove filters from an Excel sheet from VBA, so you can copy the whole dataset.
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 […]
First Class Progress Bar for all your Macros
I believe I owe you an explanation; about this post’s title. At first, you might think I am a pompous […]
How to deal with the Numbers Stored As Text Error in Excel?
How many times have you encountered the “Numbers Stored as text” error in your data sets? It interferes with your LOOKUP and MATCH […]
Magically Select All The Used Areas In A Sheet using VBA
I recently published a post about automatically formatting a table in Excel using VBA. That got me thinking, how awesome it […]
Magically Format Tables in Excel using VBA
Excel Tables make analyzing data, a breeze. It surprises me that it is not used as often as it should. It automatically […]
Get the Actual Used Range in a Spreadsheet
In one of my posts, I wrote about the UsedRange property of the Worksheet object. I use it in almost all […]
To Err is Excel, Handle your Errors with grace
Error handling is an important aspect of programming in VBA, especially if you are writing macros for other users. Unfortunately, many […]