+ Reply to Thread
Results 1 to 10 of 10

Select a range from the active cell till the final row used

  1. #1
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Select a range from the active cell till the final row used

    Hi all,

    I have a workbook that I need to open with a macro and copy a range from it to another workbook.
    as the columns will not be always on the same possiton I had to create a find the text in the column and select it.
    The next step was to go 1 cell below and activate it. Now I have problems creating the range from the active cell till the end of the last used cell in that column.

    So far I have this:

    Please Login or Register  to view this content.
    Any help will be really great ;-)

    Greetings.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Select a range from the active cell till the final row used

    Please Login or Register  to view this content.
    will work on column A, presumably you want cells(rows.count,activecell.column)
    so to select:
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Select a range from the active cell till the final row used

    Hi yudlugar,

    It works really great. Thanks a lot for your great help.

    Greetings.

  4. #4
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Select a range from the active cell till the final row used

    Hi yudlugar,

    Can I ask you one more thing?

    How is it possible to use the below macro to actually make the selection from 1 cell lower?
    Now when the macro runs, it will select the range, but it will also select a cell that has a value. I should make the selection excluding the cell that has a value and make a range from the empty cells.

    I have data in column I that the macro uses as example then it will go to column B and find fill up with data till one cell befor the one with data (in my case till column "B"row 13 has data and in column "I" till 26, so it should make a range from B26 till B14)

    Please Login or Register  to view this content.
    Greetings

  5. #5
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Select a range from the active cell till the final row used

    You can use .offset(1,0) to get the cell that is one lower:
    Please Login or Register  to view this content.
    for example

  6. #6
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Select a range from the active cell till the final row used

    Hi,
    I guess I did not express myself good, sorry for that.
    Please check the attached excel file where you can see what the outcome should be.
    I have put the fill color in green so you can see where the results should be (the previous macro will go up in column B to the used cell and then it will overwrite it, it actually should go up and make the range with only empty cells.

    Greetings.
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Select a range from the active cell till the final row used

    Hi,
    I found a solution, it is a little bit complicated, but works :-)

    Maybe some one knows a simpler and faster way to do the same.

    Please Login or Register  to view this content.
    Greetings.

  8. #8
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Select a range from the active cell till the final row used

    You don't need the select stuff:
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Select a range from the active cell till the final row used

    Hi,
    Thanks :-)
    I will try this out as soon as I can and let you know.

    Greetings.

  10. #10
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Austria
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Select a range from the active cell till the final row used

    Ok, it is working. Thanks a lot.

+ 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. Select a range from active cell
    By Spagbog in forum Excel General
    Replies: 1
    Last Post: 12-21-2011, 08:17 AM
  2. Select range from active cell
    By hutch@edge.net in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-22-2010, 11:42 AM
  3. how to auto-select range of active cell
    By panamakevin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-12-2010, 12:46 AM
  4. Select and Copy Range from Active Cell
    By Leah in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-21-2009, 03:23 PM
  5. In VB macro how do I select range from active cell
    By spydor in forum Excel General
    Replies: 5
    Last Post: 12-29-2005, 07:15 PM

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