The document discusses using VBA code in Excel to display student pictures based on their name. It uses a VLOOKUP formula to match student names in cell F1 to picture names in a table. The VBA code loops through all pictures, makes them invisible, then makes the picture matching the name in F1 visible in the same location. It displays pictures for students up to Murid8. The table lists 109 student names matched to corresponding picture numbers.
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Xl Au Contoh Lookup Gambar
1. Murid Picture 6 Private Sub Worksheet_Calculate
Murid6 Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
Next oPic
VBA yang digunakan End With
End Sub
Kita menggunakan Vlookup untuk di F1 dengan
rumus =VLOOKUP(A2, PicTable, 2, FALSE)
Untuk memasukan foto sesuai dengan urutan
picture mulai dari no 1 sampai dengan 109
yang sudah dimasukkan murid sampai dengan
murid ke 8. kalau mau merubah tinggal kliik
kanan change picture
B2 Pakai validation data LIST dengan rumus =OFFSET(PicTable,,,,1)
2. Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("F1")
For Each oPic In Me.Pictures
If oPic.Name = .Text Then
oPic.Visible = True
oPic.Top = .Top
oPic.Left = .Left
Exit For
End If
Next oPic
End With
End Sub
SET(PicTable,,,,1)