+ Reply to Thread
Results 1 to 5 of 5

Resize range to include only populated column...

  1. #1
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Resize range to include only populated column...

    Hi all

    In the attached...If user selects D2:F25 as RefEdit selection...I need code that resizes the range to populated column only...
    i.e E2:E25
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Resize range to include only populated column...

    Couldn't you use SpecialCells(xlCellTypeConstants)?
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Resize range to include only populated column...

    Thanks JLGWhiz...

    Just perfect...

  4. #4
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: Resize range to include only populated column...

    Quote Originally Posted by sintek View Post
    Thanks JLGWhiz...

    Just perfect...
    You're welcome,
    Regards, JLG

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Resize range to include only populated column...

    Have slightly adjusted file allowing for a blank value in [E13]...
    Still need E2:E25 as result
    EDIT....
    Not to worry...Tx...Was not thinking lol...
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sintek; 09-20-2018 at 03:23 AM.

+ 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] How to resize table range according to Column A last row
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-03-2017, 11:09 AM
  2. [SOLVED] need help altering my code to include the ability to choose any column as a search range
    By cmorten82 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-04-2016, 08:46 AM
  3. Modify range of chart series in existing charts to include last column
    By gregersdk in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-05-2015, 08:32 AM
  4. 2010 VBA Code for: format the print area to include only rows with populated cells
    By sambo24 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-19-2013, 10:57 AM
  5. Include a Name Range exclusively in a certain column
    By RagonichaFulva in forum Excel General
    Replies: 3
    Last Post: 02-29-2012, 09:12 AM
  6. Getting Range to move 1 column left and resize by 1
    By mozart in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-24-2005, 04:05 AM
  7. include in formula only if cell is populated?
    By themax16 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-23-2005, 02:46 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