Thread
:
Concatonate - formula too long
View Single Post
#
8
Posted to microsoft.public.excel.misc
Don Guillett
external usenet poster
Posts: 10,124
Concatonate - formula too long
Try this macro
Sub addifxinrow()
ar = ActiveCell.Row
For Each c In Range(Cells(ar, "e"), Cells(ar, "z"))
If UCase(c) = "X" Then ms = ms & "," & c.Offset(-1)
Next
MsgBox Right(ms, Len(ms) - 1)
End Sub
or a function that must go into a regular module.
Function ax() 'put in the active row at col D maybe
ar = ActiveCell.Row
For Each c In Range(Cells(ar, "e"), Cells(ar, "z"))
If UCase(c) = "X" Then ms = ms & "," & c.Offset(-1)
Next
ax = Right(ms, Len(ms) - 1)
End Function
--
Don Guillett
SalesAid Software
"Foo2U" wrote in message
...
That's true; I tried it and could only work with one value.
"David Biddulph" wrote:
Will that deal with "X"s in more than one column, which seemed to be what
the OP was after?
--
David Biddulph
"Don Guillett" wrote in message
...
Try this idea instead. Modify to suit
=INDEX(E13:J13,1,MATCH("x",E14:J14,0))
"Foo2U" wrote in message
...
I have a cell that populates by determining if the columns next to it
have
an
"X" entered. If they do, the name of the column is concatenated to
the
current text, followed by a comma. If there is no "X", no text is
added.
I
use the formula below:
=CONCATENATE(IF(E3="X",$E$2&", ","")&IF(F3="X",$F$2&",
","")&IF(G3="X",$G$2&", ","")&IF(H3="X",$H$2&",
","")&IF(I3="X",$I$2&",
","")&IF(J3="X",$J$2&", ","")& etc...
This has woked fine for awhile, but now we have too many columns and
the
formula is too long.
Any suggestions on how to make this work with a shorter formula?
Thanks in advance.
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett