+ Reply to Thread
Results 1 to 7 of 7

VBA to select range: End(xlup)-->End(Xlright)..?

  1. #1
    Forum Contributor
    Join Date
    09-20-2014
    Location
    India
    MS-Off Ver
    2013
    Posts
    275

    Question VBA to select range: End(xlup)-->End(Xlright)..?

    Dear all,

    I have been using below code to select a used range in any column and i found it to be more effective.

    Please Login or Register  to view this content.
    Now i am need of similar code to select used range in a row..? Something similar to this..

    Please Login or Register  to view this content.
    but this doesnt work.

    Please suggest how can i modify it.?

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA to select range: End(xlup)-->End(Xlright)..?

    Rows FIRST and then TURN LEFT

    ActiveSheet.Range("B2", ActiveSheet.Cells( 2,Columns.Count).End(xlToLeft)).Select
    Last edited by AB33; 02-25-2017 at 08:58 AM.

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: VBA to select range: End(xlup)-->End(Xlright)..?

    Also even this would work,

    Please Login or Register  to view this content.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  4. #4
    Forum Contributor
    Join Date
    09-20-2014
    Location
    India
    MS-Off Ver
    2013
    Posts
    275

    Re: VBA to select range: End(xlup)-->End(Xlright)..?

    @AB33: Correct...But it still throws an 'Object defined error'..

  5. #5
    Forum Contributor
    Join Date
    09-20-2014
    Location
    India
    MS-Off Ver
    2013
    Posts
    275

    Re: VBA to select range: End(xlup)-->End(Xlright)..?

    But i want to make this dynamic selection..

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: VBA to select range: End(xlup)-->End(Xlright)..?

    xlright should be xlleft

  7. #7
    Forum Contributor
    Join Date
    09-20-2014
    Location
    India
    MS-Off Ver
    2013
    Posts
    275

    Re: VBA to select range: End(xlup)-->End(Xlright)..?

    YEs yes...It must be xlleft...
    You nailed it down... Thanks for your advise...

+ 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. [SOLVED] End method argument: If xlUp = -4162, why does End(xlUp) = End(3)?
    By joe31623 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-11-2016, 06:02 AM
  2. [SOLVED] Xlup vba not select header
    By emina002 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-25-2015, 06:29 PM
  3. Select all rows up to last row that has data (xlUp command)
    By astrbac in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-28-2015, 12:25 PM
  4. range("e1" & cells(rows.Count,5).end(xlup)).Select
    By sohaila in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-09-2014, 09:27 AM
  5. VBA Codes for Cut a Column and insert xlright to selected range
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-17-2012, 07:10 AM
  6. Range & End(xlUp).Row issue
    By nuttycongo123 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-17-2011, 01:19 PM
  7. .End(xlRight)).Select Doesn't Work
    By Madcatrobert in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-12-2005, 04:06 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