Concatenate non-concurrent cells

S

shanewithers

I would like to know how I can take different cells (non concurrent)
and string them together in another cell with separators. The
CONCATENATE function can't do this. The end result that I am looking
for is to select a number of cells using a userform and listbox with
checkboxes, and have all of those values combine and be pasted into a
cell of my choosing. I have the userform, the listbox, and the
checkboxes (courtesy of John Walkenbach's book), I need to figure out
how to combine my selections into a single cell.

Thanks for your reponses in advance.


Shane
 
G

Guest

Concatenate should do what you are asking. Can you give an example of the
data you are trying to concatenate and the results? Also show what incorrect
results you are getting.
 
S

Shane

I should have been more specific. I would like to have them divided by
commas. I have found a few functions where I can put commas in, but if
I choose cells that are non-concurrent I get a #VALUE error.
 
B

Bob Phillips

=A1&","&B1&","&C1

etc.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
S

Shane

I would like to add to vba code so I can string together cell
selections chosen using checkboxes from a listbox in a userform
 
G

Gord Dibben

See one answer with a macro in excel.newusers

No listboxes, just select the cells from the worksheet.


Gord Dibben MS Excel MVP
 
B

Bob Phillips

So it is just

myVar = If Checkbox1.Value Then Range"A1").Value & ","
myVar = myVar & If Checkbox2.Value Then Range"B1").Value & ","
myVar = myVar & If Checkbox3.Value Then Range"C1").Value & ","
'etc.
myVar = Left$(myVar,Len$(myVar)-1)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top