Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Concatenate Macro
I have a list of values in Column A. In Column B - Row 1 I want to
concatenate the values from Column A - Rows 1-50 with commas in between each value, and in Column B - Row 2 I want to concatenate the values from rows 51-100 with commas in between. I'm using a ridiculously long formula right now to do this.... =A1&","&A2&","&A3&","&A4&","&A5.... and on and on and on... Can someone please help me write a macro to do this? Thanks - Dan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Concatenate Macro
Thanks a lot, that's exactly what I needed.
- Dan Gary''s Student wrote: Here is a simple function that concatentates a range of cells: Function mergem(r As Range) As String mergem = r.Cells(1, 1).Value k = 1 For Each rr In r If k < 1 Then mergem = mergem & "," & rr.Value End If k = 2 Next End Function -- Gary's Student "Dan R." wrote: I have a list of values in Column A. In Column B - Row 1 I want to concatenate the values from Column A - Rows 1-50 with commas in between each value, and in Column B - Row 2 I want to concatenate the values from rows 51-100 with commas in between. I'm using a ridiculously long formula right now to do this.... =A1&","&A2&","&A3&","&A4&","&A5.... and on and on and on... Can someone please help me write a macro to do this? Thanks - Dan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Concatenate using Macro | Excel Discussion (Misc queries) | |||
Macro concatenate formula | Excel Programming | |||
Concatenate Macro | Excel Discussion (Misc queries) | |||
Concatenate Macro | Excel Programming | |||
Running a macro to concatenate | Excel Programming |