Use VbNullString instead of
Request a callback

We'll call during UK business hours

Name:
Number:
0207 987 3777
STL

Hints and tips home » VBA hints and tips » Use VbNullString instead of

Use VbNullString instead of

When needing to default a String variable back to it's default of "" use vbNullString as in the following example:

Sub ClearText()

Dim strEmpName As String

strEmpName = "John Smith"
MsgBox strEmpName

strEmpName = vbNullString
MsgBox strEmpName

End Sub


Added by Carlos on 8th December 2006

More VBA hints and tips, like:

Training courses
London & UK

Live dates & prices »

On-site training

60-second quote »

E-Learning

From £99 · Call us »

Mailing list

Sign up for latest offers »

 

rssRSS feeds

What's this?

All hints and tips:

RSS feed


Connect with us: Google+ · Facebook · Twitter · LinkedIn · Pinterest

2nd Floor, CA House, 1 Northey Street
Limehouse Basin, London, E14 8BT
United Kingdom

info@microsofttraining.net

Resources

X

Search