+ Reply to Thread
Results 1 to 3 of 3

Global Variable is not retaining its value

Hybrid View

  1. #1
    Registered User
    Join Date
    05-13-2015
    Location
    Netherlands
    MS-Off Ver
    2013
    Posts
    13

    Global Variable is not retaining its value

    I have tried using a Public declaration at the top of my module. But It's not passing the exact value from one sub to another. It passes some value(I guess this is the value which I got when I ran the code for the first time). Any thoughts on this? Thanks

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Global Variable is not retaining its value

    Please share the code with us


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    05-13-2015
    Location
    Netherlands
    MS-Off Ver
    2013
    Posts
    13

    Re: Global Variable is not retaining its value

    Its solved now there was no problem with global variable. Actually it was because of using Worksheet_Calculate method. it was getting its value from previous calculation, so the global variable was not the right one. I changed the code by asking it to calculate the cell before running the sub
    Last edited by mahmud1280; 05-19-2015 at 10:58 AM.

+ 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. [SOLVED] Global variable declared in Userform. Variable value is not sticking
    By timtim89 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-25-2012, 08:50 AM
  2. Replies: 3
    Last Post: 09-06-2005, 12:05 PM
  3. Replies: 2
    Last Post: 09-06-2005, 06:05 AM
  4. Replies: 1
    Last Post: 07-08-2005, 11:05 PM
  5. Replies: 1
    Last Post: 07-08-2005, 09:05 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