+ Reply to Thread
Results 1 to 7 of 7

Selecting up to last cell

  1. #1
    Forum Contributor
    Join Date
    11-06-2012
    Location
    New Jersey, US
    MS-Off Ver
    Excel 2007
    Posts
    174

    Selecting up to last cell

    hello -

    I have the below and am trying to select and copy up to the last cell. i've seen all kinds of things
    but still can't figure it out. I have tried to use range, .range, .select etc but get 'With object not set' type
    error messages.

    Please Login or Register  to view this content.
    So once it finds the workbook named file*, then activate it and select from A2 down to the last cell of data.

    Thank you

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Selecting up to last cell

    Try next code.
    It works for the active sheet

    Please Login or Register  to view this content.
    - Battle without fear gives no glory - Just try

  3. #3
    Forum Contributor
    Join Date
    11-06-2012
    Location
    New Jersey, US
    MS-Off Ver
    Excel 2007
    Posts
    174

    Re: Selecting up to last cell

    Hey PCI -

    I tried your suggestion. Got a 'Select method of range class failed' error.

    Is there anything else that I may try?

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Selecting up to last cell

    See attached the set of files used to check
    Launch the macro from MAIN.xlsm
    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    11-06-2012
    Location
    New Jersey, US
    MS-Off Ver
    Excel 2007
    Posts
    174

    Re: Selecting up to last cell

    PCI - yes that worked for me if you only have data in column A....I added data thru to column J...is there anyway it can find all of this
    and select it? Do you have to say select up to column J?

  6. #6
    Forum Contributor
    Join Date
    11-06-2012
    Location
    New Jersey, US
    MS-Off Ver
    Excel 2007
    Posts
    174

    Re: Selecting up to last cell

    hey - not sure how I got it to work but here it is:

    Please Login or Register  to view this content.
    Thank you

  7. #7
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Selecting up to last cell

    Yes it good but here you are using column R while you were previously asking for J .
    Perhaps it would be better to search for the last column or other information to be more flexible.
    Perhaps also Rows.count is more that you need, what is you column reference to know the last row?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 09-30-2015, 01:01 AM
  2. Replies: 1
    Last Post: 07-22-2015, 05:23 PM
  3. Display Cell Data from a cell after selecting option from dropdown list.
    By RoyalleSky in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-20-2014, 06:04 AM
  4. Replies: 7
    Last Post: 09-29-2013, 06:12 PM
  5. Replies: 2
    Last Post: 06-03-2012, 03:33 PM
  6. [SOLVED] How to select cell to the right of active cell without selecting the activecell aswell?
    By Emmaly in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-12-2012, 07:22 AM
  7. VBA - Selecting a cell based on relative position vs cell #
    By jago_ML in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-08-2007, 03:04 AM

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