Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro concatenate formula


Hi everyone,

Im sure we all know that concatenate can be a really pain in the butt
function when you have alot of cells to concatenate and also theres a
30 cell limit.

so how would one concatenate
Column A
texta
textb
textc
textd

to

Column A
texta|textb|textc|textd

There would probably be a loop function until it finds a blank cell on
that column then it would stop. Also some columns might have more than
30cells. I have not created any macro's on excel so this would be my
first example to learn from

Thank you all,
vipjun


--
vipjun
------------------------------------------------------------------------
vipjun's Profile: http://www.excelforum.com/member.php...o&userid=35266
View this thread: http://www.excelforum.com/showthread...hreadid=552430

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Macro concatenate formula

Sub Test()
Dim iLastRow As Long
Dim i As Long

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = iLastRow To 2 Step -1
Cells(i - 1, "A").Value = Cells(i - 1, "A").Value & "|" & _
Cells(i, "A").Value
Cells(i, "A").Clear
Next i

End Sub



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"vipjun" wrote in
message ...

Hi everyone,

Im sure we all know that concatenate can be a really pain in the butt
function when you have alot of cells to concatenate and also theres a
30 cell limit.

so how would one concatenate
Column A
texta
textb
textc
textd

to

Column A
texta|textb|textc|textd

There would probably be a loop function until it finds a blank cell on
that column then it would stop. Also some columns might have more than
30cells. I have not created any macro's on excel so this would be my
first example to learn from

Thank you all,
vipjun


--
vipjun
------------------------------------------------------------------------
vipjun's Profile:

http://www.excelforum.com/member.php...o&userid=35266
View this thread: http://www.excelforum.com/showthread...hreadid=552430



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro concatenate formula


Thanks bob I was able to edit the macro for different columns.


--
vipjun
------------------------------------------------------------------------
vipjun's Profile: http://www.excelforum.com/member.php...o&userid=35266
View this thread: http://www.excelforum.com/showthread...hreadid=552430

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
Concatenate Macro osaka78 Excel Discussion (Misc queries) 6 April 9th 06 01:34 PM
using the value of a macro variable in a concatenate formula Simon W Excel Programming 4 March 2nd 06 11:15 AM
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 10:56 PM.

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

About Us

"It's about Microsoft Excel"