Macro that Finds the First Value in a range using a Combobox (drop down menu)

M

mwheelock

I have a long list of countires and some info attached to them in a
spread sheet. I want to add a drop-down menu at the top of the spread
sheet that will go to the first cell in the column that contains that
text. E.G. If I choose Peru from the menu I want it to go to that
exact cell in the spread sheet so scrolling isn't necessary. Does
anyone know any VBA code that I can assign to this control?- It's
Forms not ActiveX. Thanks.

Matt
 
T

Toppers

If you have a LINK cell e.g. B1, then this will scroll to the cell in Column A.

This assumes data (your country list) starts in row 1.

Sub DropDown2_Change()
ActiveWindow.ScrollRow = Range("B1")
End Sub

HTH
 
M

mwheelock

If you have a LINK cell e.g. B1, then this will scroll to the cell in Column A.

This assumes data (your country list) starts in row 1.

Sub DropDown2_Change()
ActiveWindow.ScrollRow = Range("B1")
End Sub

HTH






- Show quoted text -

I failed to mention that the countries are not in consecutive order.
There are a few rows between each country. Is there a formula that
will match the text chosen from the drop down menu to the text in the
spread sheet?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top