+ Reply to Thread
Results 1 to 4 of 4

VBA output without empty cells

  1. #1
    Registered User
    Join Date
    11-17-2014
    Location
    Copenhagen, Denmark
    MS-Off Ver
    MS Office 2010
    Posts
    14

    VBA output without empty cells

    Hey guys.

    I am working on a spreadsheet (see attached example), where I would like the VBA output in row 5 to be without empty cells. The idea is whenever the word Equity comes up it chooses the ISIN above the word Equity and then lists it below but without spaces. So that the 4 ISIN's above Equity are listed side by side in row 5.

    Have tried many combinations but have been unable to get it right.

    MB
    Attached Files Attached Files
    Last edited by MB1983DK; 05-28-2015 at 02:52 AM.

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

    Re: VBA output without empty cells

    This should work
    Please Login or Register  to view this content.
    The lines:
    ISIN = rng.Offset(-1, i).Value
    rng.Offset(2, DestCol).Value = ISIN



    could be combined into just one:
    rng.Offset(2, DestCol).Value = rng.Offset(-1, i).Value
    Last edited by protonLeah; 05-27-2015 at 09:39 PM.
    Ben Van Johnson

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,464

    Re: VBA output without empty cells

    This should do without loop
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-17-2014
    Location
    Copenhagen, Denmark
    MS-Off Ver
    MS Office 2010
    Posts
    14

    Re: VBA output without empty cells

    Thanks for the input

+ 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] Output Text file is empty while exporting from excel table using macros
    By arry0207 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-08-2013, 08:08 AM
  2. [SOLVED] Comparing two cells for similarities and output a third cell (if C1 = B1, then output A1)
    By PERFECT777 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-26-2013, 12:37 AM
  3. [SOLVED] How to empty the lookup output cells when the primary cells are emptied?
    By ohlalayeah in forum Excel General
    Replies: 3
    Last Post: 07-04-2012, 05:06 AM
  4. I get empty new lines in my textfile output
    By grid in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-29-2010, 08:30 AM
  5. macro to colour empty cells (cells not recognized as empty)
    By Gerben in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-30-2005, 11:05 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