Merge data from two columns using Distance.
Merge data from two columns using Distance.
Last edited by sanju2323; 02-28-2015 at 02:00 AM.
Hi sanju,
Run the Macro on the attached sheet and it will do what I think you want.
One test is worth a thousand opinions.
Click the * Add Reputation below to say thanks.
Error - Copy.jpg
Please solve problem and attach again copy
ERTAT? program is Draw Table excel to autoCAD
MarvinP Sir, or Please give me VBA CODE
Here is the recorded macro to do your problem.
![]()
Sub Macro1() ' ' Macro1 Macro ' ' Range("A2").Select Range(Selection, Selection.End(xlDown)).Select Range("A2:E3689").Select Selection.Copy Range("Q2").Select ActiveSheet.Paste Range("F3").Select Range(Selection, Selection.End(xlDown)).Select Range("F3:J1500").Select Selection.Copy Range("Q1497").Select Selection.End(xlDown).Select Range("Q3690").Select ActiveSheet.Paste Range("U3649").Select Application.CutCopyMode = False ActiveWorkbook.Worksheets("Merge Data").Sort.SortFields.Clear ActiveWorkbook.Worksheets("Merge Data").Sort.SortFields.Add Key:=Range( _ "U3649"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _ xlSortNormal With ActiveWorkbook.Worksheets("Merge Data").Sort .SetRange Range("Q3:U5187") .Header = xlNo .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With Columns("Q:Q").EntireColumn.AutoFit Columns("R:R").EntireColumn.AutoFit Columns("S:S").EntireColumn.AutoFit Columns("U:U").EntireColumn.AutoFit End Sub
sir This code works pretty awesome. But give to me a slight improvement.
1) i need result "K3" to "O".
2) No need result color format as simple format.
MarvinP Sir, File shown error -
Protected view office has detected a problem with this file. Editing it may harm your computer.
Hi sanju,
I just ran the code again and it worked fine on my Excel 2013. I simply recorded a macro and didn't edit it. I think the problem is on your end. What is ERTAT? Perhaps you are trying to run it off a server or your Virus protection software is giving you the message?
Hi Sanju,
Instead of giving you an answer it is time you learn how to answer this problem yourself. Read:
http://www.contextures.com/excel-macro-record-test.html
Here were my steps.
1. Copy the first range
2. Paste it after the second range on the right
3. Copy the second range
4. Paste it BELOW the range just pasted in step 2 above
5. Sort the new combined range by the time colum
Record the above steps and you will have exactly the macro I gave you.
You can then decide where to paste your first range.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks