![]() |
#1
|
|||
|
|||
![]()
Hello,
In column A I have blank cells or numbers (could be zero as well) In column B I have names, e.g. Peter, John, Mary etc For example let's have 3, 0, "", 4, 4, 6, 0, 5, "", 1 in column A and Peter, John, Mary, Kate, Alan, Nick, George, Jenny, Tony, Helen I am looking for a way that in one cell I will get the names that have a non-zero or non-blank cell next to them BUT IN A DESCENDING ORDER separated by commas, i.e Nick, Jenny, Kate, Alan, Peter, Helen If it is any help this is what I have been using but does not deal with the DESCENDING ORDER problem Function ccIFblank(SrcRng As Range, ConCatrng As Range) Dim diff As Integer diff = (ConCatrng.Column - SrcRng.Column) For Each c In SrcRng If c.Value <> "" Then ccIFblank = ccIFblank & c.Offset(, diff).Value & ", " End If Next ccIFblank = Left(ccIFblank, Len(ccIFblank) - 2) End Function Thanks a lot |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
officeboy09 | Excel | 13 | 08-09-2021 12:59 PM |
![]() |
marksm33 | Word VBA | 3 | 01-15-2015 05:59 PM |
Concatenate two textbox values for message box | Smithy02468 | Excel Programming | 1 | 11-08-2014 10:48 PM |
If, move and concatenate in VBA | devcon | Excel Programming | 0 | 07-04-2011 12:44 AM |
![]() |
PSYloco | Excel | 2 | 05-14-2011 03:46 PM |