+ Reply to Thread
Results 1 to 3 of 3

Macro to select cells at end of range of data

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

    Macro to select cells at end of range of data

    I currently have the following code in my macro:

    Please Login or Register  to view this content.
    It copies multiple rows of data, anywhere from 2 rows to 50+. What I am trying to do is get the below code one to take this action one row below the bottom of the range of data that has been pasted onto the sheet "Target".

    Please Login or Register  to view this content.
    The F9 and F10 cells would be relative to the bottom of the range of data being on row 7. I am not sure how to make this relative to the range pasted from the first code. So if the bottom of the rang of data was row 12, the Range("F9").Select would change to Range("F14").Select

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to select cells at end of range of data

    Hello johnlynches,

    Here is one way to accomplish the task. In VBA it seldom necessary to select an object before an action is performed on it.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,760

    Re: Macro to select cells at end of range of data

    Hi Johny

    I've changed the macro a bit. See if this is what you need for getting the pdf files.

    On sheet "Transformed" there is a border around cell N3, don't delete that as I copy this to get borders around the other cells on sheet "Target"

    Still I think you need to upload a csv file, it's much better in my opinion to import the csv files directly in excel 2007and get the proper layout at once.

    Alf
    Attached Files Attached Files

+ 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