+ Reply to Thread
Results 1 to 3 of 3

Can I clear variables within a loop?

  1. #1
    Forum Contributor
    Join Date
    03-04-2008
    Location
    Ohio
    MS-Off Ver
    Office 2010
    Posts
    208

    Can I clear variables within a loop?

    I have someone else's code that I need to modify to run in a loop. It wasn't originally written with this intent. I know that it's generating erroneous data and I suspect that it's keeping the last output from the previous run before going into the next loop, so I want to clear the variables before doing this.

    Is there a way to clear all variables globally, or do I need to write code to clear each one?

    I.E.
    Please Login or Register  to view this content.
    ???

    Thanks in advance.
    -gshock
    Last edited by VBA Noob; 08-12-2008 at 03:02 PM.

  2. #2
    Registered User
    Join Date
    11-17-2005
    Location
    Georgia
    Posts
    82

    Erase

    Where R() is an array variable:

    Erase R
    Will clear all elements of the array


    HTH


    Lee

  3. #3
    Forum Contributor
    Join Date
    03-04-2008
    Location
    Ohio
    MS-Off Ver
    Office 2010
    Posts
    208
    Quote Originally Posted by tekman
    Where R() is an array variable:



    Will clear all elements of the array


    HTH


    Lee
    tekman (a.k.a. Lee)

    Thanks for the help. That solved the issue. Many, many thanks.

    Best regards,

    -gshock

+ 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