+ Reply to Thread
Results 1 to 5 of 5

Using a variable in .offset

  1. #1
    Forum Contributor
    Join Date
    10-08-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    386

    Using a variable in .offset

    How would I get this to work? The offset will not always be the same.

    Please Login or Register  to view this content.

  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: Using a variable in .offset

    Work in what way?

    The only thing that's missing from the code is that you aren't actually doing anything with Range("A1").Offset(x,0).
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    10-08-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    386

    Re: Using a variable in .offset

    I am trying to do this with it:

    Please Login or Register  to view this content.
    I have already declared r1 as a range and previously set it to a range("c33"). x is determined by the value of another range variable. It gives me a compile error when i try to do this.

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

    Re: Using a variable in .offset

    That shouldn't happen, is it definitely a compile error?

    Have you declared all your variables inclucing x?

    Can you post the rest of the code?

  5. #5
    Forum Contributor
    Join Date
    10-08-2010
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    386

    Re: Using a variable in .offset

    Hmm...it just worked. No idea what i did wrong. Maybe just a typo. That's what i get for going to bed so late. Sorry for wasting everyone's time!

+ 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