recording macro
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Recording Macro

Recording Macro

resolvedResolved · Low Priority · Version 2003

replyReply Thu 3 Jul 2008, 16:44Delegate Akiko said...

Akiko has attended:
Excel VBA Intro Intermediate course

Recording Macro

I am not sure exactly when I should use

For upcoming training course dates see: Pricing & availability

replyReply Thu 24 Jul 2008, 12:11 Edited on Thu 24 Jul 2008, 12:12Trainer Carlos said...

Variable Scope Dim vs Public

Hi Akiko

If you declare a variable as Dim it sets it up to be seen only by the procedure or module that contains it. For example:

Sub Test()

Dim MyName as String

MyName = "Carlos"

End Sub

If I wanted to access the value of MyName from another procedure it wouldn't find it.

So if the variable you are declaring needs to be accessible by all procedures and modules in a project then it needs to be declared as Public. For example:

Public MyName as String

Hope this helps

Carlos


 

Please browse our web site to find out more about
excel course and other Microsoft training courses.

Excel tip:

Display developer tab - Excel 2010

a. In Excel, click on the File tab
b. Select Options from left hand side
c. Choose the Customize Ribbon section
d. Click the box next to Developer in the list of tabs on the right hand side of the dialog box. When ticked the Developer tab will be visible.
e. Click OK to apply your changes

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard