Writing Excel User Defined Functions in VBA – part #2 – time stamping, concatenating date and text while maintaining the date format

Hi Folks, there are many available built-in spreadsheet functions in Excel. Ocasionaly one might need to write a special custom function. This second short tutorial is an introduction to that.  Creating a “Time Stamp” function is presented as a first example after which a concatenation function between a custom formatted date and a string (text) is introduced. This last function came about from a question I was asked by a finance person at one of my courses. A date is represented in general format as the number of days passed since 31 of December 1899. You can format the cell to a normal date appearance, but if you concatenate the date with some arbitrary string you loose the date formatting. This user defined function overcomes this problem. More custom functions will be used in future models. We’d love to hear from you. Cheers, George

[sociallocker] [/sociallocker]

Leave a Reply

Your email address will not be published. Required fields are marked *