+ Reply to Thread
Results 1 to 5 of 5

Select Data with VBA

  1. #1
    Registered User
    Join Date
    01-10-2013
    Location
    Tallahassee
    MS-Off Ver
    Excel 2010
    Posts
    30

    Select Data with VBA

    Could someone please help me with this problem?

    I have data that starts with A6:D6. However, the end point is variable.

    I would like to select all the data except the last row. So if in one instance the used data range is A6: D151, I would like to select A6:D150 (leaving out the last row).

    I have this code but it does not work as I don't know how to move the ActiveCell to the southwest corner of my selection to make the offset work correctly. Currently the ActiveCell is A6 and the offset winds up selecting one row up.


    Please Login or Register  to view this content.
    I am using Excel 2007.

    --Perry
    Last edited by arlu1201; 02-05-2013 at 11:15 AM.

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Select Data with VBA

    Something like this should do the job - there's no need to select the range in question:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-10-2013
    Location
    Tallahassee
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: Select Data with VBA

    Thank you for your help. This is very useful and helps me in a few other areas as well.

  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: Select Data with VBA

    pkew22,

    Welcome to the forum.

    I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. If you need more information on how to use them, check my signature below this post.
    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]

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

    Re: Select Data with VBA

    Also,

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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