Hello Kenny07,
Welcome to the Forum!
The attached workbook will display the flag of the country entered into cell "A1" on "Sheet1". The file is loaded from the folder you gave using the country name in "A1" and adding the ".jpg" extension. This happens every time the contents of cell "A1" change. A VBA UserForm is used to display the welcome message and the country flag. Here is the associated code...
UserForm Code
Private Sub CommandButton1_Click()
'OK
Unload Me
End Sub
Private Sub UserForm_Activate()
Dim PicPath As String
On Error Resume Next
Me.Caption = "Welome to " & Range("A1") & "!"
PicPath = "'C:\Users\Pictures\Flags\"
PicPath = PicPath & Range("A1") & ".jpg"
Image1.Picture = LoadPicture(PicPath)
End Sub
Sheet1 Code
Private Sub Worksheet_Change(ByVal Target As Range)
UserForm1.Show
End Sub
Bookmarks