CellLink Value From Data Validation List

specs

New Member
Joined
Oct 26, 2005
Messages
27
Can i get cellLink values from a Data Validation List?

e.g my Validation List is in cell A1 and i chose the 2nd item.

im currently using: string = Range("A1").Value, which gives me the String of 2nd item. Is there any way i can get a value of 2 using .ListIndex or something?
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Try this:

Code:
Dim myIndex As Long
Dim myRange As Range

    Set myRange = Range(Right(Range("A1").Validation.Formula1, Len(Range("A1").Validation.Formula1) - 1)).Find(Range("A1"))
    myIndex = ActiveCell.Row - myRange.Offset(0).Row + 1

You can name the range referring to A1 in this example for more flexibility. Post back if you have any problems.
 
Upvote 0
Hi Taz, Thanks for the tip.

but ActiveCell.Row just keeps returning the same value of 1 and myRange.Offset(0).Row returns my items Row number, oftens makes the result a negative number.

It seems fine if i use:
Code:
myIndex = myRange.Offset(0).Row
Do u think its ok?
 
Upvote 0

Forum statistics

Threads
1,203,524
Messages
6,055,905
Members
444,832
Latest member
bgunnett8

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