Tuesday, July 5, 2011

Some Excel VBA Tips

Get current directory:

ActiveWorkbook.Path

Format Date :

Format(Date, "mmmm_d_yyyy")


Format Time:
Format(Now, "Hh_Nn_Ss")

Replace special characters:

If you know the character code, use the following example:

Replace(str, Chr(149), "-")