+ Reply to Thread
Results 1 to 6 of 6

Set a Range variable

  1. #1
    Forum Contributor Gabor's Avatar
    Join Date
    02-15-2004
    Location
    Székesfehérvár, Hungary
    MS-Off Ver
    xl2016
    Posts
    226

    Set a Range variable

    Hi,
    Having trouble to find out what's wrong with this one:

    Please Login or Register  to view this content.
    I get: it is an application-defined or object-defined error.
    Thanks for any hint.
    Last edited by Gabor; 05-04-2011 at 04:11 AM.
    Regards,

    Gabor

    Protect trees.. maybe one day we need to climb back....

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Set a Range variable

    The answer is in your thread Title. You don't use Set, which you must with Range variables
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Set a Range variable

    I've had a closer look at your code & you could have problems with the Range declarations, you don't define which sheet Rows.Count refers to in the way you have written the code, that's why I generally use a With Statement Yor destination range is wrongly defined as well

    Please Login or Register  to view this content.
    This might be better
    Please Login or Register  to view this content.
    Last edited by royUK; 05-04-2011 at 02:42 AM.

  4. #4
    Forum Contributor Gabor's Avatar
    Join Date
    02-15-2004
    Location
    Székesfehérvár, Hungary
    MS-Off Ver
    xl2016
    Posts
    226

    Re: Set a Range variable

    Yep, got it.
    Works fine.
    Thanks a lot.

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Set a Range variable

    the same result:

    Please Login or Register  to view this content.



  6. #6
    Forum Contributor Gabor's Avatar
    Join Date
    02-15-2004
    Location
    Székesfehérvár, Hungary
    MS-Off Ver
    xl2016
    Posts
    226

    Re: Set a Range variable

    A beauty.
    Thanks.

+ 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