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

excel vba variable type

Forum home » Delegate support and help forum » Microsoft VBA Training and help » Excel VBA variable type

Excel VBA variable type

ResolvedVersion 2003

Anna has attended:
Excel VBA Advanced course

Excel VBA variable type

I want to set a sheetname within an excel workbook as a variable but can't work out which type of variable it should be set as.

RE: Excel VBA variable type

Hi Anna

Thanks for your question

I am assuming you are refering to the name of a worksheet, rather than the worksheet object itself.

A worksheet's name is always a string. This is because it is the worksheet's key property which is used to identify it.
Thus, your variable should be a string.

Regards
Stephen

Tue 2 Mar 2010: Automatically marked as resolved.

 

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.

VBA tip:

Suspend DisplayAlerts in VBA

To stop Excel asking you things like "Do you want to delete this file...", use the following line of code at the beginning of the relevant VBA procedure:

Application.DisplayAlerts = False

At the end of the procedure make sure you use the following code to reactivate Display Alerts:

Application.DisplayAlerts = True

View all VBA hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.14 secs.