bishop7262
Board Regular
- Joined
- Jan 9, 2010
- Messages
- 87
I have two columns of names that I need to have a unique list extracted into another row. Is there any way that a macro can be created to pick from 2 columns and placed in another. Here is an example of a macro that I found that lets me create a unique list from one column and gives me the option of putting that list into any column that I choose.
Sub Button18_Click()
Dim rListPaste As Range
Dim iReply As Integer
On Error Resume Next
Set rListPaste = Application.InputBox _
(Prompt:="Please select the destination cell", Type:=8)
If rListPaste Is Nothing Then
iReply = MsgBox("No range nominated," _
& " terminate", vbYesNo + vbQuestion)
If iReply = vbYes Then Exit Sub
End If
'May need to specify [NameofSheet].Range, e.g, Sheet1.Range
Range("A6", Range("A65536").End(xlUp)).AdvancedFilter _
Action:=xlFilterCopy, CopyToRange:=rListPaste.Cells(1, 1), Unique:=True
End Sub
Sub Button18_Click()
Dim rListPaste As Range
Dim iReply As Integer
On Error Resume Next
Set rListPaste = Application.InputBox _
(Prompt:="Please select the destination cell", Type:=8)
If rListPaste Is Nothing Then
iReply = MsgBox("No range nominated," _
& " terminate", vbYesNo + vbQuestion)
If iReply = vbYes Then Exit Sub
End If
'May need to specify [NameofSheet].Range, e.g, Sheet1.Range
Range("A6", Range("A65536").End(xlUp)).AdvancedFilter _
Action:=xlFilterCopy, CopyToRange:=rListPaste.Cells(1, 1), Unique:=True
End Sub