+ Reply to Thread
Results 1 to 4 of 4

Use last column with data as ending column in range selection with VBA

  1. #1
    Forum Contributor
    Join Date
    07-03-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    139

    Use last column with data as ending column in range selection with VBA

    I have a very simple question, but for the life of me can not seem to get the answer from online, way too many and too complex solutions for what I am trying to find.

    I simply need to know how to change the following code to replace the Z3 ending cell, to the same row, but last column that has data. This will be used in variety of different sheets, so the last column will not always be Z, it may be H, AA, etc etc etc.

    Can some one please answer this simple question as all the articles I have seen are very complex or just trying to find the value of the last cell with data, which is not what I am looking for.

    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Use last column with data as ending column in range selection with VBA

    Hey there try this:

    Please Login or Register  to view this content.
    Let me know if this works

    Thanks!

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Use last column with data as ending column in range selection with VBA

    hi lday75. will it always be row 3? you can do a variable for the column
    Please Login or Register  to view this content.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Forum Contributor
    Join Date
    07-03-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    139

    Re: Use last column with data as ending column in range selection with VBA

    benishiryo - THANK YOU, this did exactly what I was looking for. Issue SOLVED.

    rvasquez - Yours was good to, however I have some cells in between, groupings if you will, that have spacer columns between them, your solution only selected up to that first spacer column.

    thanks peeps so much, i was getting a little flustered!! LoL

+ 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