+ Reply to Thread
Results 1 to 4 of 4

Declaring Object References at Module Level

  1. #1
    Registered User
    Join Date
    04-22-2012
    Location
    Syracuse, NY, USA
    MS-Off Ver
    Office 365
    Posts
    61

    Declaring Object References at Module Level

    In my code I have a lot of references to Worksheets. Is it possible to declare the object references once at the module level?
    Reality is stranger than fiction.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    11,735

    Re: Declaring Object References at Module Level

    You need to explain better and provide some examples.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    04-22-2012
    Location
    Syracuse, NY, USA
    MS-Off Ver
    Office 365
    Posts
    61

    Re: Declaring Object References at Module Level

    Fair. I know that the following code is giving me an error but I want to know where I'm going wrong.
    Please Login or Register  to view this content.
    Essentially I'm trying define these Object References once and have them accessible as such anywhere within my VBA code.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Declaring Object References at Module Level

    you can declare them but you can't assign them there. much easier to just use the codename when referring to the sheets in your code (it acts as a variable)
    Josie

    if at first you don't succeed try doing it the way your wife told you to

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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