Hi,
try this.
Cheers,
Thomas
Sub Macro6()
'
Application.Goto Reference:="R1C1"
Application.Goto Reference:="R1C19"
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "=COUNTIF(R1C1:R3500C1,RC[-18])"
Selection.Copy
Application.Goto Reference:="R1C19"
ActiveCell.Range("A1:A3499").Select
ActiveCell.Activate
ActiveSheet.Paste
Application.Goto Reference:="R1C1"
Application.CutCopyMode = False
Calculate
Application.Goto Reference:="R1C19"
ActiveCell.Columns("A:A").EntireColumn.Select
Calculate
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Calculate
Application.Goto Reference:="R1C19"
Application.Goto Reference:="R1C20"
ActiveCell.FormulaR1C1 = "=IF(RC[-1]>1,RC[-1],"""")"
ActiveCell.FormulaR1C1 = "=IF(RC[-1]>1,RC[-19],"""")"
Application.Goto Reference:="R1C21"
ActiveCell.FormulaR1C1 = "=IF(RC[-2]>1,"""",RC[-20])"
Application.Goto Reference:="R1C20"
ActiveCell.Range("A1:B1").Select
Selection.Copy
ActiveCell.Range("A1:B3500").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Calculate
Application.Goto Reference:="R1C20"
ActiveCell.Columns("A:B").EntireColumn.Select
Calculate
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.Goto Reference:="R1C20"
Application.CutCopyMode = False
Calculate
ActiveCell.Columns("A:A").EntireColumn.Select
Selection.Sort Key1:=ActiveCell, Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Application.Goto Reference:="R1C21"
ActiveCell.Columns("A:A").EntireColumn.Select
Selection.Sort Key1:=ActiveCell, Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Application.Goto Reference:="R1C20"
'End Sub
'Sub Macro7()
'
'
Application.Goto Reference:="R1C19"
ActiveCell.Columns("A:A").EntireColumn.Select
Selection.TextToColumns Destination:=ActiveCell, DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, OtherChar _
:=".", FieldInfo:=Array(1, 1)
Application.Goto Reference:="R1C20"
ActiveCell.Columns("A:A").EntireColumn.Select
Selection.TextToColumns Destination:=ActiveCell, DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, OtherChar _
:=".", FieldInfo:=Array(1, 1)
Application.Goto Reference:="R1C21"
ActiveCell.Columns("A:A").EntireColumn.Select
Selection.TextToColumns Destination:=ActiveCell, DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, OtherChar _
:=".", FieldInfo:=Array(1, 1)
Application.Goto Reference:="R1C1"
Application.Goto Reference:="R1C19"
End Sub