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

visual+basic+excel - declaring variables

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » visual+basic+excel - Declaring variables

visual+basic+excel - Declaring variables

ResolvedVersion Standard

James has attended:
Excel VBA Intro Intermediate course

Declaring variables

I've declared a byte variable as public at the start of a form.

A process in this form opens another form which gives an integer value (1 or 0) to the variable, and then the main form should take the variable value forward.

The only way I found to avoid an undefined compile error was to define the variable at the start of both forms (both as public), but the variable value isn't read across from one form to the next.

Thanks

RE: Declaring variables

Found a way round it was to define the Variable as Public in a Module instead of at the start of the forms... this seems to solve the problem

 

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:

Select blank cells automatically

Get Excel to find any blank (empty) cells in a region for you by:

1. Selecting the appropriate region from your spreadsheet.

2. On the menu bar, go to Edit - Go to.

3. Click the 'Special' button, then select Blanks and click OK.

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.1 secs.