Jump to a TAB from a Drop-Down Menu

gauravvadehra

New Member
Joined
Sep 12, 2024
Messages
7
Office Version
  1. 2021
Platform
  1. Windows
  2. Mobile
Hi,
I have an excel sheet with multiple TAB's. Each is a Product Name and that TAB contains that product's Buyers List and email address.
This will obviously keep increasing over time and difficult to keep scrolling through to find the product TAB.
I want to create a 1st PAGE or 1st TAB who has a simple Drop Down Menu showing Name of Each PRODUCT TAB and once o select it, it takes to that that TAB.

I have made a rudimentary screenshot of what i need.

If someone can help me, please do let me know how this can be done?
Thanks so much !

Screenshot 2024-09-12 115500.png
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Can i see inside Product? what is exactly it contain?
Hi,
Thanks for your reply.
See attached the screenshot of each product sheet.

But i don't want it to link to any of that data..
I just want the "Main Menu" to simply have a drop down pointing to the product sheet
 

Attachments

  • Screenshot 2024-09-12 132410.png
    Screenshot 2024-09-12 132410.png
    87.8 KB · Views: 3
Upvote 0
Hi Gaurav,

You can use the below code in your sheet "Select product option" and change the Range("B5") to your respective cell :

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

    On Error Resume Next

    If Not (Application.Intersect(Range("B5"), Target) Is Nothing) Then ThisWorkbook.Sheets(Target.Value).Activate

End Sub
 
Upvote 0
Problem with design like this is when you have 100 products then you will need make 100 sheets too just to hold them info/detail, here is what i do with just 3 sheets (Setting, Database, Dashboard) :


screen-capture-1_uWJkYVDX-ezgif.com-video-to-gif-converter (1) (2).gif
 
Upvote 0
Problem with design like this is when you have 100 products then you will need make 100 sheets too just to hold them info/detail, here is what i do with just 3 sheets (Setting, Database, Dashboard) :


View attachment 116751
YES YES, This is exactly i would like to do.. Please help me or send me a temple to copy paste my date in that.
Would really appreciate that. Thanks so so much.
 
Upvote 0
YES YES, This is exactly i would like to do.. Please help me or send me a temple to copy paste my date in that.
Would really appreciate that. Thanks so so much.
Give me half an hour, i'm still at the office making stuff looks right lol, i'll be back.
 
Upvote 0
1. Create 3 Sheets, rename it to Setting, Database, Dashboard.

2. On Setting sheet, create table for Product Name (i assume there is no duplicate name for product, so we don't have to make Product ID), in this table put whole product you have.



Book1
ABC
1Product Name
2Triclabendazole
3Bupivacaine
4Mebendazole
5
6
7
8
9
10
11
Setting




3. On Database sheet, create table for hold the information about the customer associated with the product, so you will need column Product Name, Buyer's Name, Email and Name, put your whole data into it.



Book1
ABCDEF
1Product NameBuyer's NameEmailName
2TriclabendazoleBIOMONTatencionalcliente@biomont.com.peMr. Excel
3BupivacaineCPQ PREMEZCLAS SA DE CVinfo@grupocpq.comMr. Happy
4TriclabendazoleNEGOCIAR VETERINARIA S A Cnegociar@negociar.com.peMr. Ok
5
6
7
8
9
10
11
12
13
14
Database




4. On Dashboard sheet, put ComboBox from ActivexControl to hold the product name, Developer > Insert > choose ComboBox from Activex Control

here it is.jpg


5. Right click on that ComboBox, choose properties, change Style from "0 frmStyleDropDownCombo" to "2 frmStyleDropDownList"

6. Still on Dashboard sheet, put some header for the table display, Buyer's Name, Email and Name, YOU HAVE TO DO THIS ON ROW 3 or you will get unexpected result (if you don't want to do that on row 3 then you have to change a bit of the code to make them fit each others).

7. The idea is when someone choose something on this combobox then table below it (Table Display) will show the data associated with that product, to achieve that put this code to your Dashboard Sheet Code Environment :



VBA Code:
Option Explicit



Private Sub ComboBox1_Change()

    Dim oWsDatabase As Worksheet

    Dim oWsDashboard As Worksheet

    Dim iLastRowDatabase, iLastRowDashboard, i As Long

  

    Dim colData As New Collection

    Dim arrData As Variant

    Dim varData As Variant

  

    Set oWsDatabase = ThisWorkbook.Worksheets("Database")

    Set oWsDashboard = ThisWorkbook.Worksheets("Dashboard")

  

    iLastRowDatabase = oWsDatabase.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row

    iLastRowDashboard = oWsDashboard.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row

  

    If iLastRowDatabase > 1 Then

        arrData = oWsDatabase.Range("A2:D" & iLastRowDatabase).Value

      

        For i = LBound(arrData) To UBound(arrData)

            If arrData(i, 1) = Me.ComboBox1.Value Then

                colData.Add arrData(i, 2) & "/" & arrData(i, 3) & "/" & arrData(i, 4)

            End If

        Next i

      

        With oWsDashboard

            If iLastRowDashboard > 3 Then .Range("A4:C" & iLastRowDashboard).Delete Shift:=xlUp



            iLastRowDashboard = 4



            For Each varData In colData

                arrData = Split(varData, "/")



                .Range("A" & iLastRowDashboard) = arrData(0)

                .Range("B" & iLastRowDashboard) = arrData(1)

                .Range("C" & iLastRowDashboard) = arrData(2)



                iLastRowDashboard = iLastRowDashboard + 1

            Next varData

        End With

    End If

End Sub



Private Sub Worksheet_Activate()

    Dim oWs As Worksheet

    Dim iLastRow As Long

    Dim arrData As Variant

  

    Set oWs = ThisWorkbook.Worksheets("Setting")

    iLastRow = oWs.UsedRange.Rows.Count

  

    arrData = oWs.Range("A2:A" & iLastRow).Value

  

    Me.ComboBox1.List = arrData

End Sub

8. Done
 
Upvote 0
1. Create 3 Sheets, rename it to Setting, Database, Dashboard.

2. On Setting sheet, create table for Product Name (i assume there is no duplicate name for product, so we don't have to make Product ID), in this table put whole product you have.



Book1
ABC
1Product Name
2Triclabendazole
3Bupivacaine
4Mebendazole
5
6
7
8
9
10
11
Setting




3. On Database sheet, create table for hold the information about the customer associated with the product, so you will need column Product Name, Buyer's Name, Email and Name, put your whole data into it.



Book1
ABCDEF
1Product NameBuyer's NameEmailName
2TriclabendazoleBIOMONTatencionalcliente@biomont.com.peMr. Excel
3BupivacaineCPQ PREMEZCLAS SA DE CVinfo@grupocpq.comMr. Happy
4TriclabendazoleNEGOCIAR VETERINARIA S A Cnegociar@negociar.com.peMr. Ok
5
6
7
8
9
10
11
12
13
14
Database




4. On Dashboard sheet, put ComboBox from ActivexControl to hold the product name, Developer > Insert > choose ComboBox from Activex Control

View attachment 116753

5. Right click on that ComboBox, choose properties, change Style from "0 frmStyleDropDownCombo" to "2 frmStyleDropDownList"

6. Still on Dashboard sheet, put some header for the table display, Buyer's Name, Email and Name, YOU HAVE TO DO THIS ON ROW 3 or you will get unexpected result (if you don't want to do that on row 3 then you have to change a bit of the code to make them fit each others).

7. The idea is when someone choose something on this combobox then table below it (Table Display) will show the data associated with that product, to achieve that put this code to your Dashboard Sheet Code Environment :



VBA Code:
Option Explicit



Private Sub ComboBox1_Change()

    Dim oWsDatabase As Worksheet

    Dim oWsDashboard As Worksheet

    Dim iLastRowDatabase, iLastRowDashboard, i As Long

 

    Dim colData As New Collection

    Dim arrData As Variant

    Dim varData As Variant

 

    Set oWsDatabase = ThisWorkbook.Worksheets("Database")

    Set oWsDashboard = ThisWorkbook.Worksheets("Dashboard")

 

    iLastRowDatabase = oWsDatabase.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row

    iLastRowDashboard = oWsDashboard.Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row

 

    If iLastRowDatabase > 1 Then

        arrData = oWsDatabase.Range("A2:D" & iLastRowDatabase).Value

     

        For i = LBound(arrData) To UBound(arrData)

            If arrData(i, 1) = Me.ComboBox1.Value Then

                colData.Add arrData(i, 2) & "/" & arrData(i, 3) & "/" & arrData(i, 4)

            End If

        Next i

     

        With oWsDashboard

            If iLastRowDashboard > 3 Then .Range("A4:C" & iLastRowDashboard).Delete Shift:=xlUp



            iLastRowDashboard = 4



            For Each varData In colData

                arrData = Split(varData, "/")



                .Range("A" & iLastRowDashboard) = arrData(0)

                .Range("B" & iLastRowDashboard) = arrData(1)

                .Range("C" & iLastRowDashboard) = arrData(2)



                iLastRowDashboard = iLastRowDashboard + 1

            Next varData

        End With

    End If

End Sub



Private Sub Worksheet_Activate()

    Dim oWs As Worksheet

    Dim iLastRow As Long

    Dim arrData As Variant

 

    Set oWs = ThisWorkbook.Worksheets("Setting")

    iLastRow = oWs.UsedRange.Rows.Count

 

    arrData = oWs.Range("A2:A" & iLastRow).Value

 

    Me.ComboBox1.List = arrData

End Sub

8. Done
Thansk so much. Did what i cold understand, but getting some errors.
Could u tell me where do i need to Insert the VBA exactly ?Rest all i have done. I am getting the drop down also, but theres nothing inside it
 
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,791
Members
451,589
Latest member
Harold14

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