Creating named ranges

FryGirl

Well-known Member
Joined
Nov 11, 2008
Messages
1,368
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I need to create a couple of dependent data validation cells and I know I can create named ranges and then use the Indirect function in the first data validation cell to populate the second.

Is there any way to automate this process? First extract the unique items from column A into column D and then for each value in column D extract the the corresponding values into columns E, F, G, etc,.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Any thoughts on an automated process to to compare the values in the extracted list from column D and then use each item to create more named ranges with all the items from C which match D and place those ranges starting in E and to the right until done?

Column A contains multiples of North and South, while column B will contain all the values which belong to either North or South.
 
Upvote 0
Step by step!
Unique values in column D:
Code:
Sub extract_unique_value()
Columns("A").Copy Destination:=Columns("D")
n = Cells(Rows.Count, "D").End(xlUp).Row
For r = 1 To n
For rw = r + 1 To n
If Cells(rw, "D") = Cells(r, "D") Then
Cells(rw, "D").Delete
End If
Next rw, r
End Sub
Then?
 
Upvote 0
Ciao machopicho,

Thank you for the code, but it didn't work quite right. Instead of unique's it pulled over all values.

Also, I had to remove option explicit to get it to work because the variables were not defined.

The code below will work to extract the unique's from A into D and now to get the unique's per D out of B. As I was thinking about this maybe a filter will work using the values in D starting with D2 until the list is exhausted. What do you think?

Code:
Sub ExtractUnique()
    Range("A1", Range("A" & Rows.Count).End(xlUp)).AdvancedFilter _
    Action:=xlFilterCopy, CopyToRange:=Range("D1"), Unique:=True
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,703
Members
452,938
Latest member
babeneker

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