+ Reply to Thread
Results 1 to 2 of 2

Select a range of columns including the last non-empty column

  1. #1
    Registered User
    Join Date
    04-19-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    87

    Select a range of columns including the last non-empty column

    Hi

    I have the following code to find the last non-empty column:

    Please Login or Register  to view this content.
    This is column H in this case (column number 8) so LC returns 8 but it may be column M tomorrow so I can't hardcode this.
    I want to select and then autosize columns A to the last column.

    What is the code to do this?

    I tried Columns("A:"Lc).select but no luck there. Tried a few others too.

    cheers

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    Win10/MSO2016
    Posts
    12,995

    Re: Select a range of columns including the last non-empty column

    Please Login or Register  to view this content.
    Ben Van Johnson

+ 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] Excel VBA macro to select range separated by blank row and copy to next empty column
    By hackini in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-29-2013, 02:13 AM
  2. [SOLVED] How to select all records in a empty column between to filled columns
    By boerbende in forum Excel General
    Replies: 3
    Last Post: 11-20-2011, 07:37 AM
  3. How to select columns A thru D down to including last row
    By Launchnet in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-06-2011, 01:11 AM
  4. How to hide all empty columns without including the column header
    By mkingsberry in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-09-2010, 12:27 PM
  5. Macro: select entire range with empty columns in between
    By nachousa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2010, 09:54 AM

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