+ Reply to Thread
Results 1 to 8 of 8

Variable definition problem

  1. #1
    Forum Contributor
    Join Date
    07-25-2012
    Location
    San Antonio, Texas
    MS-Off Ver
    Excel 2010
    Posts
    142

    Variable definition problem

    Hello all,

    In my efforts to learn and use tools well beyond my understanding, I've run into an issue, go figure. Below is some code I've seen elsewhere and which was tried and true in the workbook I acquired it from, however, it's no longer working in my own workbook. Variable not defined is the error I'm getting but I thought the variable was already defined, per the code below.

    Any assistance is greatly appreciated. Since I'm still a beginner, I'm oblivious as to what I've done wrong and/or why.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Thanks in advance,

    -Orestees

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Variable definition problem

    Try the following:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    07-25-2012
    Location
    San Antonio, Texas
    MS-Off Ver
    Excel 2010
    Posts
    142

    Re: Variable definition problem

    I've tried the sugegsted code but I'm getting a "Compile error: Duplicate declaration in current scope."

    -Orestees

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

    Re: Variable definition problem

    if the error is in the second part of code have you declared cell as Range anywhere?
    Josie

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

  5. #5
    Forum Contributor
    Join Date
    07-25-2012
    Location
    San Antonio, Texas
    MS-Off Ver
    Excel 2010
    Posts
    142

    Re: Variable definition problem

    JosephP, sorry, it's actually in the first part of the code. Does DIM = declaration? I would have thought the second code would have defined this. Should I add this to another area or module in addition to where it already is?
    -Orestees

  6. #6
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Variable definition problem

    Maybe take out the

    Please Login or Register  to view this content.

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

    Re: Variable definition problem

    I mean
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    07-25-2012
    Location
    San Antonio, Texas
    MS-Off Ver
    Excel 2010
    Posts
    142

    Re: Variable definition problem

    Perfect, that fixed it!!! Thanks rvasquez and JosephP! Thanks a ton!

+ 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