I have a sheet which lists part numbers in column A and has a drop down list in column B which specifically corresponds to the part number in the adjacent cell. The drop down list references a name range "MyFinish" which has the following code "=OFFSET(MyFinishList,0,0,COUNTA(MyFinishList),1)"
"MyFinishList" is another namerange with the code "=INDEX(Table1,0,MATCH(Lozier!A13,Table1[#Headers],0))"
"myCategory" refers to the "Table1" Headers and has finish codes listed vertically under the "#Headers" which is each part number listed in Column A.
This allows the drop down to only list the available colors for the part listed in the adjacent cell.
If I change the part however, the displayed drop down value shows the previous item until it is manually clicked in which the list displays the updated items corresponding to the new part.
I would like to know if there is a way through VBA to automatically display the 1st item in the drop down list so that they are automatically updated anytime the part list in column A is updated.
I can perform this action if the data validation is referencing a range but have not figured out how to reference a name range.
I have uploaded a sample of my workbook along with my current code to simply update cell B2 to the 1st item.
https://www.dropbox.com/s/c5binlryifqlo56/Test.xlsm?dl=0
Any help would be greatly appreciated.
"MyFinishList" is another namerange with the code "=INDEX(Table1,0,MATCH(Lozier!A13,Table1[#Headers],0))"
"myCategory" refers to the "Table1" Headers and has finish codes listed vertically under the "#Headers" which is each part number listed in Column A.
This allows the drop down to only list the available colors for the part listed in the adjacent cell.
If I change the part however, the displayed drop down value shows the previous item until it is manually clicked in which the list displays the updated items corresponding to the new part.
I would like to know if there is a way through VBA to automatically display the 1st item in the drop down list so that they are automatically updated anytime the part list in column A is updated.
I can perform this action if the data validation is referencing a range but have not figured out how to reference a name range.
I have uploaded a sample of my workbook along with my current code to simply update cell B2 to the 1st item.
https://www.dropbox.com/s/c5binlryifqlo56/Test.xlsm?dl=0
Code:
Sub ChangeFinish()
Range("B2").Value = Range(Replace(Range("B2").Validation.Formula1, "=", "")).Cells(1, 1).Value
End Sub
Any help would be greatly appreciated.