Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

defining variables

ResolvedVersion 2003

Hannah has attended:
Excel VBA Intro Intermediate course

Defining variables

what is a string.

RE: defining variables

Hi Hannah

When declaring varalbles one variable type is a String.

A string is a character or a combination of characters that constitute text of any kind and almost any length.

So to declare a string variable you write the following:

Dim UserName As String

Text-based controls such as the TextBox, the ListBox, or the ComboBox controls, have a property called Text. This property is of type String.

So when using such a control, to access the string that it holds you call its Text property. So if you have a text box with the user name you would code

UserName = txtUserName.Text

Hope this helps

Carlos

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Repeat action

The F4 key will usually repeat your last action. e.g. delete a row, then select another row and press F4 to delete again.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.