+ Reply to Thread
Results 1 to 3 of 3

Accessing Dim from child sub

  1. #1
    Registered User
    Join Date
    08-10-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    12

    Accessing Dim from child sub

    Hi All,

    I need to to use dates in different formats in many of my Sub.

    What i thought i could do is creat a sub as below and run the sub/function before i run my main sub.

    Please Login or Register  to view this content.
    and then run the code from the main sub

    Please Login or Register  to view this content.
    How can i get this to work?

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Accessing Dim from child sub

    Hello,

    if you want to access a variable in different procedures, you need to declare it at the top of the module as a public variable.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-10-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Accessing Dim from child sub

    Thank you, it worked.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1