Results 1 to 4 of 4

Thread: Select last used cell And it's Offset
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Mar 2018
    Posts
    111
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Select last used cell And it's Offset

    I would like to use "Range("G" & Rows.Count).End(xlUp)" to determine the last used cell in Range("G"), and select it AND its "Offset(1,0)". I am running into issues when pairing it with the Autofill code from Macro Recorder. See below:

    What I need to do (This is only an example, and does not use the method shown above):
    Range("L2").Select
    Selection.AutoFill Destination:=Range("L2:L450"), Type:=xlFillDefault
    Range("L2:L450").Select

    BUT, I am having issues pairing the method which selects the last used cell AND it's row offset of 1. I.E. see below:

    Range("G" & Rows.Count).End(xlUp).Select
    Selection.AutoFill Destination:='Issues here, Type:=xlFillDefault
    'Issues here

  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,353
    Post Thanks / Like
    Mentioned
    471 Post(s)
    Tagged
    47 Thread(s)

    Default Re: Select last used cell And it's Offset

    How about
    Code:
       With Range("G" & Rows.Count).End(xlUp)
          .Offset(0).AutoFill .Resize(2), xlFillDefault
       End With
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  3. #3
    Board Regular
    Join Date
    Mar 2018
    Posts
    111
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Select last used cell And it's Offset

    That's the one. Thank you Fluff.

  4. #4
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,353
    Post Thanks / Like
    Mentioned
    471 Post(s)
    Tagged
    47 Thread(s)

    Default Re: Select last used cell And it's Offset

    You're welcome & thanks for the feedback
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •