+ Reply to Thread
Results 1 to 3 of 3

Problem with public global declared variables

  1. #1
    Registered User
    Join Date
    07-16-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    6

    Problem with public global declared variables

    I am trying to figure out what I am doing wrong with global/public declarations. In the code I am writing, I have the following code in the “ThisWorkbook”
    Please Login or Register  to view this content.

    Then in another sheet I have am using the command to transfer the value:
    Please Login or Register  to view this content.
    The value of HemiRes is always 0, no matter what I seem to do. Is there something I an not correctly understanding about the way I can save values to a public declared variable from any sheet?

    Thanks

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Problem with public global declared variables

    Public declarations go in standard modules (Insert>Modules).
    If posting code please use code tags, see here.

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Problem with public global declared variables

    Put the declaration in a module, not This_Workbook

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Lots of Global Variables. Is this a problem?
    By jerseyguy1996 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-24-2009, 11:25 PM
  2. Global/Public
    By Fox via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-26-2006, 03:50 PM
  3. [SOLVED] public or global array
    By shishi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-06-2006, 05:35 PM
  4. [SOLVED] Public vs Global
    By quartz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-09-2005, 03:06 PM
  5. [SOLVED] How to reference a public array (declared in module) from a proced
    By Amzee in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-11-2005, 05:06 PM

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