The following are the basics of using the StringFormat UDF

The StringFormat function performs the function 'Format' that is available within VBA.

The syntax of the function is:

=StringFormat(originalstring, pattern)


originalstring can be a string ("string to be changed.") or cell reference (A1) representing the data to be formatted.

pattern can be a string ("000") or cell reference (A2) representing the format.


I use this to change the format of numbers to a fixed width i.e. 1 to 001, 47 to 047 by using the following in a cell:

=StringFormat(A1, "000")



Created with the Personal Edition of HelpNDoc: Free help authoring tool