LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
JRM
 
Posts: n/a
Default Macro to Combine 2 columns to make one column without merging

I found this macro courtesy of Dave:

Option Explicit
Sub testme02()

Dim myRng As Range
Dim myArea As Range
Dim myRow As Range
Dim myCell As Range
Dim myStr As String

Set myRng = Selection

Application.DisplayAlerts = False
For Each myArea In myRng.Areas
If myArea.Columns.Count 1 Then
For Each myRow In myArea.Rows
myStr = ""
For Each myCell In myRow.Cells
myStr = myStr & " " & myCell.Text
Next myCell
myRow.Merge across:=True
myRow.Cells(1).Value = Mid(myStr, 2)
Next myRow
End If
Next myArea
Application.DisplayAlerts = True

End Sub

And it does a good job of merging but I need to just cut the data in the
right column and splice it onto the end of the data in the left column. That
way when I'm finished the right column can be deleted. If I merge then the
right column can't be deleted and it ruins my export to CSV files.

Thanks for your help!

Richard
--
When we die, we leave all that we have... and take with us all that we are.
Ravi Zacharias
 
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
Macro to compare two columns of data Odawg Excel Discussion (Misc queries) 1 October 12th 05 02:51 PM
Macro to compare two columns of data Odawg Excel Discussion (Misc queries) 0 October 12th 05 03:13 AM
Stack multiple columns into one column... is there an easy way? Julian Excel Discussion (Misc queries) 2 September 16th 05 07:31 PM
MERGING COLUMNS WITH DUPLICATE INFO. PatrickL Excel Worksheet Functions 2 August 19th 05 02:39 PM
Merging columns of data Frank D. Nicodem, Jr. Excel Discussion (Misc queries) 2 March 4th 05 08:29 PM


All times are GMT +1. The time now is 09:54 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"