+ Reply to Thread
Results 1 to 5 of 5

End of range help on macro

  1. #1
    Registered User
    Join Date
    01-12-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    47

    End of range help on macro

    I'm trying to insert a formula starting at H2 and go to the end of my range of data, but I'm not sure how to do that. I keep getting errors whenever I try something. Here is what I have tried:

    Please Login or Register  to view this content.
    and

    Please Login or Register  to view this content.
    Please let me know what I am missing. Thanks.
    Last edited by johnlynches; 03-31-2012 at 03:57 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: End of range help on macro

    Hi,

    Range("H2").Copy Destination:= Range("H3:H" & Range("H" &Rows.Count).End(xlUp).Row)

    Regards
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    01-12-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: End of range help on macro

    I pasted this new code in, but only H2 gets the correct forumla in it. H3 gets an incorrect formula, and all other cells below that are blank.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    01-12-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: End of range help on macro

    Do you know how I would edit this to apply to my entire range of data as well?

    Please Login or Register  to view this content.
    Thanks.

  5. #5
    Registered User
    Join Date
    01-12-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    47

    Re: End of range help on macro

    I fixed the issue. In the Range("H" & Rows.Count).End(xlUp).Row) the column H was empty so I had to choose a different column. 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