defining variables

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

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Defining variables

Defining variables

resolvedResolved · Low Priority · Version 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:

Adding Rows or Columns in an Excel 2010 Worksheet

If you want to add a row to an Excel spreadsheet, these are the simple steps you should take:

With your mouse, right click on the row header below where you want the new row to be added. Then, click Insert.

Follow exactly the same steps if you want to add a column to an Excel worksheet, right click on the column header, choose Insert and the new column will be inserted to the left of the selected column.

View all Excel hints and tips


Server loaded in 0.07 secs.