+ Reply to Thread
Results 1 to 11 of 11

Range(Selection, Selection.End(xlDown)).Select goes to 65536 instead of last filled row

  1. #1
    Registered User
    Join Date
    05-22-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    11

    Range(Selection, Selection.End(xlDown)).Select goes to 65536 instead of last filled row

    Hi I try to make an selection in a macro, but it seems to make an selection to the end of the column. For example... the cells are now filled till B144 but after using Range(Selection, Selection.End(xlDown)).Select it goes to B65536. Same happens when I do this manually with Ctrl End Down keys.

    How can I fix this?

    Is there an other way to make this selection?

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Range(Selection, Selection.End(xlDown)).Select goes to 65536 instead of last filled ro

    Any reason why you want to do the selection?

    If you want to copy (maybe) the data, you do not need to select. If you want to copy from row 144 (or even a row which changes everytime), do this

    Please Login or Register  to view this content.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    05-22-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Range(Selection, Selection.End(xlDown)).Select goes to 65536 instead of last filled ro

    I want to use the next sub on it...

    Please Login or Register  to view this content.
    I just noticed that the blank cells all have some spaces in it... what is causing the selection till 65536...

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Range(Selection, Selection.End(xlDown)).Select goes to 65536 instead of last filled ro

    Try this
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-22-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Range(Selection, Selection.End(xlDown)).Select goes to 65536 instead of last filled ro

    I am not sure if that part of coding will work... and I rather leave it as it works exactly on the part that is selected.

    I figured out what is causing the spaces on all the other cells.

    It is the next part of code:

    Please Login or Register  to view this content.
    This part of coding is autofilling the formula all the way till row 65536. If I can make sure it does not go any further then the last filled cell of column C it would help me out a lot.

  6. #6
    Registered User
    Join Date
    05-22-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Range(Selection, Selection.End(xlDown)).Select goes to 65536 instead of last filled ro

    I found some coding and tried to modify it for myself...

    but I am getting the a 1004 error. obviously I am big noob and got some parameters wrong.

    Please Login or Register  to view this content.
    Does anybody know how to alter it to my situation?

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Range(Selection, Selection.End(xlDown)).Select goes to 65536 instead of last filled ro

    Try this.

    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  8. #8
    Registered User
    Join Date
    05-22-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Range(Selection, Selection.End(xlDown)).Select goes to 65536 instead of last filled ro

    Still an error 1004 :-/

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Range(Selection, Selection.End(xlDown)).Select goes to 65536 instead of last filled ro

    Try
    Please Login or Register  to view this content.

  10. #10
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Range(Selection, Selection.End(xlDown)).Select goes to 65536 instead of last filled ro

    Maybe:

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    05-22-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Range(Selection, Selection.End(xlDown)).Select goes to 65536 instead of last filled ro

    Thanks you all!

    It seemed there was a ")" to many at the end of the formula causing the 1004 error..
    I am using Arlu's version now. but I think Norie's would do as well.

+ 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