+ Reply to Thread
Results 1 to 5 of 5

VBA return non blanks

  1. #1
    Registered User
    Join Date
    03-21-2016
    Location
    Mexico, mty
    MS-Off Ver
    2007
    Posts
    3

    VBA return non blanks

    Hello,

    I'm working with a ton of data, and I need to arrange all of it in a specific way
    I'm currently getting the data from the original sheet with formulas, but it also returns blank cells, and then putting the non blanks values in range into another column with this formula:

    =IFERROR(INDEX($A$1:$A$1500,SMALL(IF(LEN($A$1:$A$1500)>0,ROW($A$1:$A$1500)),ROW(1:1))),"")

    Is there a VBA code to generate a formula that could do this so it could and be a bit more efficient?

    Thanks

    I hope this image makes things a bit clearer...
    Capture.JPG

  2. #2
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: VBA return non blanks

    Hi
    Try to use a regular formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I hope this helps

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: VBA return non blanks

    Quote Originally Posted by José Augusto View Post
    =IFERROR(INDEX(A$1:A$1500,1/AGGREGATE(14,6,1/(--(LEN($A$1:$A$1500)>0)*ROW($A$1:$A$1500)),ROW(1:1))),"")
    The AGGREGATE function is not available in Excel 2007. See OP's profile.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: VBA return non blanks

    Quote Originally Posted by Tony Valko View Post
    The AGGREGATE function is not available in Excel 2007. See OP's profile.
    I forgot to see that.

  5. #5
    Registered User
    Join Date
    03-21-2016
    Location
    Mexico, mty
    MS-Off Ver
    2007
    Posts
    3

    Re: VBA return non blanks

    Demn. I got excited! Jajaja

+ 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. How to return blanks in Excel?
    By BillJo in forum Excel General
    Replies: 2
    Last Post: 03-17-2015, 04:59 PM
  2. [SOLVED] Array Formula - Return blanks instead of zero
    By rogelioperrett in forum Outlook Formatting & Functions
    Replies: 2
    Last Post: 10-15-2014, 10:00 AM
  3. How to return list from values skipping blanks
    By ARayburn in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-23-2013, 04:35 PM
  4. Function to Return the first value of a row (With blanks and errors)
    By k2i2 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-15-2013, 04:19 PM
  5. vlookup to return 0 and blanks
    By jvbeats in forum Excel General
    Replies: 5
    Last Post: 03-04-2013, 12:45 PM
  6. Concatenate with carriage return- how to remove blanks?
    By ewellis in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-24-2008, 02:49 PM
  7. How to return blanks for $0.00 cells?
    By DrMutley in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2007, 07:33 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