writing code lines

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Writing Code lines

Writing Code lines

resolvedResolved · Low Priority · Version 2003

Erika has attended:
Excel VBA Intro Intermediate course

Writing Code lines

When do you use Public as a String instead of Dim?

Dim vs Public in Variable declaration

Hi Erika

When declaring variables you use the Public setting when you want the variable to be seen and be accessible by all procedures and modules in a project (eg Forms).

A Dim declaration sets the variable to be seen only by the procedure or module that contains it.

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:

Hide data in Excel Worksheets

Let's say you have some data in cell 'C5' you would like to hide from the casual viewer.

Click cell 'C5' to select it.

Click the 'Format' menu, select 'Cells'. When the 'Format Cells' dialogue box opens, click the 'Numbers' tab (if necessary), then select 'Custom' from the 'Category' list.

Double-click the 'Type' entry box and type three semi-colons: ";;;"

Click 'OK' to close the dialogue box and accept the new formatting.

The data in cell 'C5' disappears. It's still there and will work in calculations, but it isn't visible.

If you need to check the data, just click the blank cell and the contents appear in the 'Formula bar'.

View all Excel hints and tips


Server loaded in 0.08 secs.