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
Croma
up to 10.21.0812.15.10 to 15.30.12
InstallationCalibration (with Gauge)Calibration (with Laser)InstallationCalibration (with Gauge)Calibration (with Laser)
Expert1213211122
Intermediate112221
Beginner113114
Fresher108107

<colgroup><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>


Machine_D sheet
Croma
Dept.Engineerup to 10.21.0812.15.10 to 15.30.12
15 InstallationCalibration (with Gauge)Calibration (with Laser)InstallationCalibration (with Gauge)Calibration (with Laser)
ServiceMohan RExpertExpertExpertExpertExpertExpert
141410141410
ServiceMore MaheshExpertExpertFresherExpertExpertFresher
1212 1010
ServiceJigar GajjarFresherExpertExpertFresherExpertExpert
000000
ServiceSunil VermaExpertExpertFresherExpertExpertFresher
770770
ServiceAnup JainExpertExpertFresherExpertExpert
44 33
ServiceRangan HariharanExpertExpertIntermediateExpertExpertIntermediate
ServiceRathish UnniExpertExpertFresherExpertExpertFresher
220220
ServiceGovindraj ShinoyExpertExpertFresherExpertExpertFresher
44 44
ServicePrayag OCExpertExpertFresherExpertExpertFresher
220000
ServiceVikas TKBeginnerBeginnerBeginnerBeginnerBeginnerBeginner
ServiceArun KumarExpertExpertIntermediateExpertExpertBeginner
1010610106
ServiceArun Kumar NExpertExpertFresherExpertExpertFresher
ServiceKuldeep NagarExpertExpertBeginnerIntermediateIntermediateBeginner
444444
ServiceRavi KumarExpertExpertFresherExpertExpertFresher
88 88
ServiceJithin DevIntermediateIntermediateBeginnerIntermediateIntermediateBeginner

<colgroup><col><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
I'll be thankful for a quick support since i need to submit this sheet by tomorrow.
Kind Regards.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
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,214,791
Messages
6,121,611
Members
449,038
Latest member
apwr

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