macros for other applications

D

Douvid

Hi,
I can't make the opposite of "text to column" in Excell (
I mean merging cells but placing a coma between each
value) so I use word to replace paragraph mark by coma.
But how do I writte in my macros the macros that works in
Word and recall the transfomed data in excell ?
Cheers,
 
T

Tom Ogilvy

Concatenation is the action you describe

sStr = Range("A1").Value & ", " & Range("B1").Value _
& ", " & Range("C1").Value

is Possibly what you want.

Regards,
Tom Ogilvy
 
D

Douvid

yes it is something like that but how do you do a loop on
this ? if possible , because sometimes I have 1000 cells
to merge.
 
T

Tom Ogilvy

for Rows

sStr = ""
for i = 1 to 1000
sStr = sStr & Cells(i,"A").Value & ", "
Next



for columns

sStr = ""
for i = 1 to 256
sStr = sStr & Cells(3,i).Value & ", "
Next

Regards,
Tom Ogilvy
 

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