Pop up window when click/double click a cell

kuldeepnagar

New Member
Joined
May 9, 2019
Messages
12
Dear All
I have two sheets with some information on skill level of a team and with year of experience. Machine_A sheet is summary of no. of skilled person. Machine_D is sheet of data base. Let us assume i have 10 expert engineer in machine installation category. Machine_A sheet shows no. 10. When i double click or click that cell, it should show me name of all that 10 engineers in a pop up window. If possible, It should show year of experience with name. Under the name of engineer, no shown is year of experience. I am unable to attach my file due to forum rule but i am pasting my data here
Machine_A sheet
[TABLE="width: 582"]
<colgroup><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD][/TD]
[TD="colspan: 6"]Croma[/TD]
[/TR]
[TR]
[TD][/TD]
[TD="colspan: 3"]up to 10.21.08[/TD]
[TD="colspan: 3"]12.15.10 to 15.30.12[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Installation[/TD]
[TD]Calibration (with Gauge)[/TD]
[TD]Calibration (with Laser)[/TD]
[TD]Installation[/TD]
[TD]Calibration (with Gauge)[/TD]
[TD]Calibration (with Laser)[/TD]
[/TR]
[TR]
[TD]Expert[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]13[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]11[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]Intermediate[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]Beginner[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]Fresher[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]7
[/TD]
[/TR]
</tbody>[/TABLE]


Machine_D sheet
[TABLE="width: 649"]
<colgroup><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD="colspan: 6"]Croma[/TD]
[/TR]
[TR]
[TD]Dept.[/TD]
[TD]Engineer[/TD]
[TD="colspan: 3"]up to 10.21.08[/TD]
[TD="colspan: 3"]12.15.10 to 15.30.12[/TD]
[/TR]
[TR]
[TD]15[/TD]
[TD] [/TD]
[TD]Installation[/TD]
[TD]Calibration (with Gauge)[/TD]
[TD]Calibration (with Laser)[/TD]
[TD]Installation[/TD]
[TD]Calibration (with Gauge)[/TD]
[TD]Calibration (with Laser)[/TD]
[/TR]
[TR]
[TD]Service[/TD]
[TD]Mohan R[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]Service[/TD]
[TD]More Mahesh[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Fresher[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Fresher[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]12[/TD]
[TD] [/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Service[/TD]
[TD]Jigar Gajjar[/TD]
[TD]Fresher[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Fresher[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD]Service[/TD]
[TD]Sunil Verma[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Fresher[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Fresher[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD]Service[/TD]
[TD]Anup Jain[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Fresher[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[TD] [/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]3[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Service[/TD]
[TD]Rangan Hariharan[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Intermediate[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Intermediate[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Service[/TD]
[TD]Rathish Unni[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Fresher[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Fresher[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD]Service[/TD]
[TD]Govindraj Shinoy[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Fresher[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Fresher[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[TD] [/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Service[/TD]
[TD]Prayag OC[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Fresher[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Fresher[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[/TR]
[TR]
[TD]Service[/TD]
[TD]Vikas TK[/TD]
[TD]Beginner[/TD]
[TD]Beginner[/TD]
[TD]Beginner[/TD]
[TD]Beginner[/TD]
[TD]Beginner[/TD]
[TD]Beginner[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Service[/TD]
[TD]Arun Kumar[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Intermediate[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Beginner[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD]Service[/TD]
[TD]Arun Kumar N[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Fresher[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Fresher[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Service[/TD]
[TD]Kuldeep Nagar[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Beginner[/TD]
[TD]Intermediate[/TD]
[TD]Intermediate[/TD]
[TD]Beginner[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]Service[/TD]
[TD]Ravi Kumar[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Fresher[/TD]
[TD]Expert[/TD]
[TD]Expert[/TD]
[TD]Fresher[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]8[/TD]
[TD] [/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]8[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Service[/TD]
[TD]Jithin Dev[/TD]
[TD]Intermediate[/TD]
[TD]Intermediate[/TD]
[TD]Beginner[/TD]
[TD]Intermediate[/TD]
[TD]Intermediate[/TD]
[TD]Beginner[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]
I'll be thankful for a quick support since i need to submit this sheet by tomorrow.
Kind Regards.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Try the following.


Put the following code in the events of the "Machine_A" sheet

Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    UserForm1.Show
    Cancel = True
End Sub



Create a userform with a listbox and a commandbutton

fc9955ced4fa53027620b9a5be4cafb4.jpg






Put the following code in the userform

Code:
Private Sub UserForm_Activate()
    Dim sh As Worksheet, skill As String, i As Long
    
    Set sh = Sheets("Machine_D")
    col = ActiveCell.Column + 1
    skill = Cells(ActiveCell.Row, "A").Value
    For i = 4 To sh.Cells(Rows.Count, col).End(xlUp).Row
        If sh.Cells(i, col).Value = skill Then
            ListBox1.AddItem sh.Cells(i, "B").Value
            ListBox1.List(ListBox1.ListCount - 1, 1) = sh.Cells(i + 1, col).Value
        End If
    Next
End Sub


Private Sub CommandButton1_Click()
    Unload Me
End Sub


Check my test file

https://www.dropbox.com/s/v05opqsirdgbscg/Pop up window.xlsm?dl=0
 
Last edited:
Upvote 0
Dear DanteAmor Thank you so much for your quick and prompt support. I tried exactly what you said and able to get list with name but not year of experience. Also i have three category of engineer and it is showing all three together where as i want only from corresponding category. Please find attached my file. help me in getting it done.
https://www.dropbox.com/s/domkj4c67wigcoi/Skill Matrix_1.xlsm?dl=0


Add this line to see years of experience
Code:
 ListBox1.ColumnCount = 2

You did not mention that you had 3 categories, nor do you comment how to identify the range of each of them, but in your sheet there are only empty rows between one category and another, but that is not a pattern to identify where each category meets and where it ends.

But, Try this:

Code:
Private Sub UserForm_Activate()
    Dim sh As Worksheet, skill As String, i As Long
    
    Set sh = Sheets("CMM_D")
    col = ActiveCell.Column + 1
    skill = Cells(ActiveCell.Row, "B").Value
    
    If Range("A" & ActiveCell.Row).MergeCells Then
        cat = Range("A" & ActiveCell.Row).MergeArea.Cells(1, 1)
        cat = WorksheetFunction.Trim(Left(cat, InStr(1, cat, "(") - 1))
    End If
    ListBox1.ColumnCount = 2
    
    For i = 4 To sh.Cells(Rows.Count, col).End(xlUp).Row
        If sh.Cells(i, col).Value = skill And sh.Cells(i, "B").Value = cat Then
            ListBox1.AddItem sh.Cells(i, "C").Value
            ListBox1.List(ListBox1.ListCount - 1, 1) = sh.Cells(i + 1, col).Value
        End If
    Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,151
Members
453,021
Latest member
Justyna P

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