Hello Jayant,
You can include an Error handler in your code.
EXAMPLE;
Sub FormatData()
On Error Goto FormatError
Text = Format(<String, <Format)
Exit Sub
FormatError:
MsgBox "The Format specified is Invalid", vbOKOnly + vbCritical
End Sub
In the code, "FormatError:" is a Line Label and must not haveany spaces
before it.
Sincerely,
Leith Ross
--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile:
http://www.excelforum.com/member.php...o&userid=18465
View this thread:
http://www.excelforum.com/showthread...hreadid=379089