Return rown number in a range

Ziggy12

Active Member
Joined
Jun 26, 2002
Messages
365
Hi there
The code below selects a variable length range on a worksheet. I need to return the cell contents of what list index returns in the column to the left o the selected range.

E.g if range B10:B30 is selected and listindex returns 10 then I need to return the content of A20.

Something like =Index(A10:A30,10)

Private Sub ComboBox2_Change()
ComboBox3.Value = ""
ComboBox4.Value = ""
X = ComboBox2.ListIndex
Select Case ComboBox2.ListIndex

Case "-1"
ComboBox3.RowSource = ""
Case Else
'ComboBox3.RowSource = "ClinicalGrp" & Format(ComboBox2.ListIndex + 1, "000")
Range("ServiceArea" & Format(ComboBox1.ListIndex + 1, "000")).Select

Test = "ServiceArea" & Format(ComboBox2.ListIndex + 1, "000")
End Select
End Sub

cheers
ziggy
 

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.

Forum statistics

Threads
1,224,603
Messages
6,179,850
Members
452,948
Latest member
UsmanAli786

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