Change Month (words) to (numbers)
Here's why.
1. You do not have to remember your formula. It is easier to remember
MonthToNumber, don't you think? You write MonthToNumber(c2) and
immediately know what that means.
2. You can tailor the function so that is behaves the way you really
want it to and what is even more important: if you need to make a
change later on you do it IN ONE PLACE instead of having to go through
all the sheets that contain the formula. Isn't it nice? :) Think how
time-consuming it would be to have to go over the spreadsheets and
correct the formula you have written.
3. This function is REALLY fast. Try it and you will see for yourself
:) I would be very surprised if you needed something that should be
faster than this. It is true that VBA proc are slower than the built-in
functions, no question about it, but everything depends on what
requirements you have as to the particular task in mind. I don't think
she needed anything better than the function I presented. If I am
wrong, sorry then :)
One thing I forgot to add. If you put the function in a module in
Personal.xls, be sure to add a reference to this workbook in order to
be able to use the function without qualifying it with the workbook's
name, like =Personal.xls!MonthToNumber(a1). In the VBA Editor go to
Tools - References and tick the Personal option. Or, of course, you
can add the function to a module in the workbook you are working on and
then do nothing apart from using it as you would use a standard
built-in function.
Now, I think I have convinced you of the obvious fact that it is much
much better to use a VBA formula than not. If you do not feel
satisfied, well, I believe I can't help it any more :)
Kind regards
Darlove (PL)
I would say that the only reason for a UDF is if there is no other solution
or if the other solution is very complex, neither of which would fit this
case. Also think of the consequences if the OP needs to share the workbook,
that means the UDF has to be distributed as well.
Peo
|