I need function or macro code which is Concatente multiple cells in single cell.
i have attach sample workbook
I need function or macro code which is Concatente multiple cells in single cell.
i have attach sample workbook
Happy to Help
VISHA
Click *, if the suggestion helps you!
If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>> "Mark your thread as Solved"
Try this code
![]()
Option Explicit Sub concatenate_rows() Dim i As Long, lrow As Long Application.ScreenUpdating = False With Worksheets("Sheet1") .Rows(1).Insert lrow = .Range("A" & .Rows.Count).End(xlUp).Row For i = lrow To 2 Step -1 If .Range("A" & i - 1).Value <> "" Then .Range("A" & i - 1).Value = .Range("A" & i - 1).Value & " " & .Range("A" & i).Value .Rows(i).ClearContents End If Next i .Rows(1).Delete End With MsgBox "Done" Application.ScreenUpdating = True End Sub
If I have helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
Thank u
Arlu ance again...
it works Good Day
try
![]()
Option Explicit Sub test() Dim myArea As Range With Range("a1", Range("a" & Rows.Count).End(xlUp)) For Each myArea In .SpecialCells(2).Areas If myArea.Rows.Count > 1 Then myArea.Cells(1, 2) = _ Join$(Application.Transpose(myArea.Value)) Else myArea.Cells(1, 2).Value = myArea.Value End If Next End With End Sub
Hi,Jindon
thank for quick reply great
one more way:
![]()
Sub ConcantateFromColumnA() 'http://www.excelforum.com/excel-programming-vba-macros/898088-concatenate-multiple-row-in-single-row.html 'Author: MaczaQ 07-Feb-2013 For Each ar In Columns(1).SpecialCells(xlCellTypeConstants).Areas Debug.Print ar.Address If ar.Cells.Count = 1 Then ar.Cells(1, 1).Offset(, 1).Value = ar.Cells(1, 1).Value Else ar.Cells(1, 1).Offset(, 1).Value = Join(Application.Transpose(ar.Cells), " ") End If Next ar End Sub
Best Regards
MaczaQ
---------------------------------------------------------------------------------------------------------------------------
If you are satisfied with the solution(s) provided, please mark your thread as Solved
If you are pleased with my answer consider to rate it. To thank someone who has helped you, click on the star icon below their name.
- This way you will add him some reputation points ... thanks in advance.
Hi, MacazQ
Thanku working good
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks