View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Leith Ross[_38_] Leith Ross[_38_] is offline
external usenet poster
 
Posts: 1
Default Invalid "format string" argument in Format fuction


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