Hello,
I have the following UDF that pulls all values for a matching criteria.
Currently, the list is displayed horizontally in one cell. How can I achieve displaying the results vertically with each result occupying one cell?
Can that be done through this or do I need another piece of code?Public Function FindSeries(TRange As Range, MatchWith As String) For Each cell In TRange If cell.Value = MatchWith Then x = x & cell.Offset(0, 1).Value & ", " End If Next cell FindSeries = Left(x, (Len(x) - 2)) End Function
Thanks for any help.
Hi, You could Modify you function,or insert as new function.
If you insert this function in a column level with your range and Drag it down to the bottom, you will get you results, or did you want only the positive answers in a list ???
Regards MickPublic Function FindSeries(TRange As Range, MatchWith As String) Dim Mch If TRange.Value = MatchWith Then Mch = TRange.Offset(0, 1).Value End If FindSeries = Mch End Function
Hello Snake10,
I've added the code to place the text vertical in the cell with the first letter at the bottom. You can change the text orientation by degree. The range is from -90 to 90.
Sincerely,Public Function FindSeries(TRange As Range, MatchWith As String) For Each cell In TRange If cell.Value = MatchWith Then x = x & cell.Offset(0, 1).Value & ", " End If Next cell ActiveCell.Orientation = 90 FindSeries = Left(x, (Len(x) - 2)) End Function
Leith Ross
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks