Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Concatenate using Macro Gaura215 Excel Discussion (Misc queries) 0 February 9th 11 02:07 PM
Macro concatenate formula vipjun Excel Programming 2 June 15th 06 08:47 PM
Concatenate Macro osaka78 Excel Discussion (Misc queries) 6 April 9th 06 01:34 PM
Concatenate Macro mully Excel Programming 11 January 4th 06 05:05 PM
Running a macro to concatenate pcor[_2_] Excel Programming 1 July 23rd 03 10:09 PM


All times are GMT +1. The time now is 12:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"