+ Reply to Thread
Results 1 to 7 of 7

function similar to offset to offset the offset

  1. #1
    Forum Contributor
    Join Date
    10-16-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    112

    function similar to offset to offset the offset

    I am trying to use the function offset to select the range of B:H Only

    But when I use the offset function, the range becomes B:I.

    Is there a way to unoffset the offset

    Usually with the keyboard shortcut I use, Shift+Right

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: function similar to offset to offset the offset

    Why do you need to use offset at all in this case? Is column H the last column with data?

    Generally speaking, if you need to offset to the left, you can use negative numbers, ie
    Please Login or Register  to view this content.
    I'm not sure I fully understand your question, though

  3. #3
    Forum Contributor
    Join Date
    10-16-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: function similar to offset to offset the offset

    That's correct, Column H is the last column with data, but I am trying to write a Macro that will be universal for all other workbook.

    So I'm trying to select the range from the last column to Column B only.

    If I use the offset function, it includes column I in the range.

    Also I get an error when I try to offset it by -1

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Jerseynjphillypa; 08-03-2012 at 02:56 PM.

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

    Re: function similar to offset to offset the offset

    if you always want column B then
    Please Login or Register  to view this content.
    assuming you really need to select for some reason
    Josie

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

  5. #5
    Forum Contributor
    Join Date
    10-16-2011
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    112

    Re: function similar to offset to offset the offset

    Thanks for the help.

    How would I be able to select the range up to Row 5 only if I started from Row 17

    So I'm looking for B5:H17 only for my range based on the code you provided above
    I believe this worked

    Please Login or Register  to view this content.
    Last edited by Jerseynjphillypa; 08-03-2012 at 03:06 PM.

  6. #6
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: function similar to offset to offset the offset

    I feel like there are a lot of steps in there to select the cells B:LASTCOL in the LASTROW. Try this code instead. Less lines:

    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: function similar to offset to offset the offset

    just replace selection.row with 5

+ 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