View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Wouldn't know what to call it!

Since I didn't know your range I just tested with a selected range of a mix
of numbers and text. Worked just fine. If all else fails, you may send your
workbook to my address below along with snippets of these msgs.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"1Fish2Fish" wrote in message
...
Don,

Thank you so much for responding. I'm not the best at VBA so I'm getting
a
runtime error of "invalid procedure." The line with the error is MsgBox
Right(ms, Len(ms) - 1). Can you assist?


"Don Guillett" wrote:


Sub ifvaluestring()
For Each c In Selection 'range("a2:a22")
If Len(Application.Trim(c)) 0 And IsNumeric(c) Then ms = ms & "," & c
Next
MsgBox Right(ms, Len(ms) - 1)
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"1Fish2Fish" wrote in message
...
I have a "table" that I created. It's just a basic grid with items on
the
y
axis and items on the x axis (ex. types of fruit on the top, number of
fruit
in the basket down the side). I need to pull the numbers of fruit in
each
basket, without adding them up, and combine them into one line,
separating
each with a comma. (Ex. 3, 4, 5, 6, 7, 8,...). I was able to do that
by
using "&", however, if there is no fruit in the basket (0), how can I
not
have a comma with a blank space appear until I do have fruit again (ex.
2,3,4,15,16,17,18,19,25 instead of
2,3,4,,,,,,,,,,,,,15,16,17,,,,,,,,,18,,19,,,,,,,25 )? I have the
possibility
of 144 entries, but also the posibility of only 1 entry. I'm trying to
stay
away from an "IF" function because it may end up very involved. Any
help
is
greatly appreciated. I'm sorry if I didn't explain it well!!