Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I am trying to create a drop down menu that will go to the specific
cell where that same text is in a worksheet when that text is selected from the dropdown menu(combobox). I made a combobox menu from the Forms menu not the Control. The text I am trying to find with this macro is a list of countries in column B that starts row 2. In Columns C,D, E there are surcharges that start in row 2 and continue a number of rows down depending on the country. This format repeats itself for some 146 countries on down the spreadsheet in terms of rows. Is there a formula that can jump to or go to each country's cell location on the spread sheet from the dropdown menu so the user doesn't have to scroll through 2000 rows to find the right country? e.g. Brazil is B2, Paraguay-B24, Venezuela-B46. Thanks. Matty |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
try: macro is attached to your combobox and G1 is the link cell for your
combobox. I have assumed your combox input range is in column A. Sub DropDown1_Change() ActiveWindow.ScrollRow = 1 nrow = Application.Match(Cells(Range("G1") + 1, "A"), Range("B:B"), 0) ActiveWindow.ScrollRow = nrow End Sub HTH " wrote: I am trying to create a drop down menu that will go to the specific cell where that same text is in a worksheet when that text is selected from the dropdown menu(combobox). I made a combobox menu from the Forms menu not the Control. The text I am trying to find with this macro is a list of countries in column B that starts row 2. In Columns C,D, E there are surcharges that start in row 2 and continue a number of rows down depending on the country. This format repeats itself for some 146 countries on down the spreadsheet in terms of rows. Is there a formula that can jump to or go to each country's cell location on the spread sheet from the dropdown menu so the user doesn't have to scroll through 2000 rows to find the right country? e.g. Brazil is B2, Paraguay-B24, Venezuela-B46. Thanks. Matty |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
On Jul 13, 3:02 pm, Toppers wrote:
try: macro is attached to your combobox and G1 is the link cell for your combobox. I have assumed your combox input range is in column A. Sub DropDown1_Change() ActiveWindow.ScrollRow = 1 nrow = Application.Match(Cells(Range("G1") + 1, "A"), Range("B:B"), 0) ActiveWindow.ScrollRow = nrow End Sub HTH " wrote: I am trying to create a drop down menu that will go to the specific cell where that same text is in a worksheet when that text is selected from the dropdown menu(combobox). I made a combobox menu from the Forms menu not the Control. The text I am trying to find with this macro is a list of countries in column B that starts row 2. In Columns C,D, E there are surcharges that start in row 2 and continue a number of rows down depending on the country. This format repeats itself for some 146 countries on down the spreadsheet in terms of rows. Is there a formula that can jump to or go to each country's cell location on the spread sheet from the dropdown menu so the user doesn't have to scroll through 2000 rows to find the right country? e.g. Brazil is B2, Paraguay-B24, Venezuela-B46. Thanks. Matty- Hide quoted text - - Show quoted text - the last statement, ActiveWindow.ScrollRow = nrow, is giving an error: nrow = error2042, when I drag the cursor over it. I can't tell if it works yet. |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
You will get an "nrow" error if it cannot match the country in the drop down
with those in column B. If still get errors, post sample w/sheet to: toppers <at NOSPAMjohntopley.fsnet.co.uk Remove NOSAPAM Try: Sub DropDown1_Change() ActiveWindow.ScrollRow = 1 nrow = Application.Match(Cells(Range("G1") + 1, "A"), Range("B:B"), 0) If not iserror(nrow) then ActiveWindow.ScrollRow = nrow Else Msgbox Cells(range("G1")+1,"A") & " not found" end if " wrote: On Jul 13, 3:02 pm, Toppers wrote: try: macro is attached to your combobox and G1 is the link cell for your combobox. I have assumed your combox input range is in column A. Sub DropDown1_Change() ActiveWindow.ScrollRow = 1 nrow = Application.Match(Cells(Range("G1") + 1, "A"), Range("B:B"), 0) ActiveWindow.ScrollRow = nrow End Sub HTH " wrote: I am trying to create a drop down menu that will go to the specific cell where that same text is in a worksheet when that text is selected from the dropdown menu(combobox). I made a combobox menu from the Forms menu not the Control. The text I am trying to find with this macro is a list of countries in column B that starts row 2. In Columns C,D, E there are surcharges that start in row 2 and continue a number of rows down depending on the country. This format repeats itself for some 146 countries on down the spreadsheet in terms of rows. Is there a formula that can jump to or go to each country's cell location on the spread sheet from the dropdown menu so the user doesn't have to scroll through 2000 rows to find the right country? e.g. Brazil is B2, Paraguay-B24, Venezuela-B46. Thanks. Matty- Hide quoted text - - Show quoted text - the last statement, ActiveWindow.ScrollRow = nrow, is giving an error: nrow = error2042, when I drag the cursor over it. I can't tell if it works yet. |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
On Jul 13, 5:28 pm, Toppers wrote:
You will get an "nrow" error if it cannot match the country in the drop down with those in column B. If still get errors, post sample w/sheet to: toppers <at NOSPAMjohntopley.fsnet.co.uk Remove NOSAPAM Try: Sub DropDown1_Change() ActiveWindow.ScrollRow = 1 nrow = Application.Match(Cells(Range("G1") + 1, "A"), Range("B:B"), 0) If not iserror(nrow) then ActiveWindow.ScrollRow = nrow Else Msgbox Cells(range("G1")+1,"A") & " not found" end if " wrote: On Jul 13, 3:02 pm, Toppers wrote: try: macro is attached to your combobox and G1 is the link cell for your combobox. I have assumed your combox input range is in column A. Sub DropDown1_Change() ActiveWindow.ScrollRow = 1 nrow = Application.Match(Cells(Range("G1") + 1, "A"), Range("B:B"), 0) ActiveWindow.ScrollRow = nrow End Sub HTH " wrote: I am trying to create a drop down menu that will go to the specific cell where that same text is in a worksheet when that text is selected from the dropdown menu(combobox). I made a combobox menu from the Forms menu not the Control. The text I am trying to find with this macro is a list of countries in column B that starts row 2. In Columns C,D, E there are surcharges that start in row 2 and continue a number of rows down depending on the country. This format repeats itself for some 146 countries on down the spreadsheet in terms of rows. Is there a formula that can jump to or go to each country's cell location on the spread sheet from the dropdown menu so the user doesn't have to scroll through 2000 rows to find the right country? e.g. Brazil is B2, Paraguay-B24, Venezuela-B46. Thanks. Matty- Hide quoted text - - Show quoted text - the last statement, ActiveWindow.ScrollRow = nrow, is giving an error: nrow = error2042, when I drag the cursor over it. I can't tell if it works yet.- Hide quoted text - - Show quoted text - That works! You can ignore my e-mail if you like. Thanks so much for taking the time with this! I sincerely appreciate it. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
what is code to activate a combo box in control toolbox | Excel Discussion (Misc queries) | |||
Source code for combo box in form | Excel Discussion (Misc queries) | |||
combo box on change code | Excel Discussion (Misc queries) | |||
Drop Down List Box, Combo Box | Excel Discussion (Misc queries) | |||
Combo Box Code | Excel Discussion (Misc queries) |