P
Potsy
Hi
I have loked on www.mcgimpsey.com and there are instructions on how to
change a graphic when the user name changes. I have the data list
validated with the names and Picture1 etc on sheet title "Names" cell
range "=Names!$A$2:$B$5" and on another sheet titled "Cover Sheet" I
have the drop down linking to the "Names" sheet by Insert>Name>Define
and calling it "PicTable". Then I have inserted the following VLOOKUP
on "Cover Sheet": =VLOOKUP(A34, PicTable, 2, FALSE) which is pulling
in the names correctly but only pulling in the text Picture1, Picture2
etc and not the actual picture.
I have entered the following code in Visual Basic editor under the
"Cover Sheet" tab
Option Explicit
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("A32")
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
The problem is the pictures held on 'Cover Sheet' do not show,
although text is correct on VLOOKUP with picture number, the coding is
also now hiding other graphics - e.g. our logo on the cover sheet.
Can anyone help as not experienced in coding, but okay in excel.
Is there anyway to do this outside visual basic?
I have loked on www.mcgimpsey.com and there are instructions on how to
change a graphic when the user name changes. I have the data list
validated with the names and Picture1 etc on sheet title "Names" cell
range "=Names!$A$2:$B$5" and on another sheet titled "Cover Sheet" I
have the drop down linking to the "Names" sheet by Insert>Name>Define
and calling it "PicTable". Then I have inserted the following VLOOKUP
on "Cover Sheet": =VLOOKUP(A34, PicTable, 2, FALSE) which is pulling
in the names correctly but only pulling in the text Picture1, Picture2
etc and not the actual picture.
I have entered the following code in Visual Basic editor under the
"Cover Sheet" tab
Option Explicit
Private Sub Worksheet_Calculate()
Dim oPic As Picture
Me.Pictures.Visible = False
With Range("A32")
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
The problem is the pictures held on 'Cover Sheet' do not show,
although text is correct on VLOOKUP with picture number, the coding is
also now hiding other graphics - e.g. our logo on the cover sheet.
Can anyone help as not experienced in coding, but okay in excel.
Is there anyway to do this outside visual basic?