need help with creating macro for unique list from 2 rows

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
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Why not just combine the 2 columns into one and use the code you already have?
 
Upvote 0
great question. I am trying to make a user friendly excel sheet. I will have many people using this that are not comfortable with using pc much less messing around with excel. So was just wondering if there was a more user friendly way to do this.
 
Upvote 0
I did mean use code to combine the 2 columns, is that any use?

That should be pretty straightforward unless there's more to what you want to do.

For example, do you want the user to deide where the unique list ends up?
 
Upvote 0
Sorry misunderstood. I just do not know how to change the code to do what I need. If the code could combine and create a unique list and place it in another column that would be what I am looking for. I would like the unique list to go into a particular column, example c7
 
Upvote 0

Forum statistics

Threads
1,214,548
Messages
6,120,141
Members
448,948
Latest member
spamiki

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top