![]() |
Automatically insert signature in worksheet
I need to automatically insert a picture in a worksheet depending on certain
cell value. e.g. if cell A1=1, picture1 will show in cell B5, if cell A1=2, picture2 will show in cell B5, if cell A1=3, No graphic will show in cell B5. Any help would be greatly appreciated. Thanks |
Automatically insert signature in worksheet
Hi John,
See JE McGimpsey's approach and downloadable sample workbook at: http://www.mcgimpsey.com/excel/lookuppics.html JE's code could readily be adapted to accord with your requirements. --- Regards, Norman "John Davies" wrote in message ... I need to automatically insert a picture in a worksheet depending on certain cell value. e.g. if cell A1=1, picture1 will show in cell B5, if cell A1=2, picture2 will show in cell B5, if cell A1=3, No graphic will show in cell B5. Any help would be greatly appreciated. Thanks |
Automatically insert signature in worksheet
Thanks for your help, but can you advise me how I can adapt the code to have
the picture show in more than 1 location. Basically the picture is a scanned signature and for example if cell A1=1, the signature needs needs to show up on 3 different sections of the sheet. Thanks "Norman Jones" wrote: Hi John, See JE McGimpsey's approach and downloadable sample workbook at: http://www.mcgimpsey.com/excel/lookuppics.html JE's code could readily be adapted to accord with your requirements. --- Regards, Norman "John Davies" wrote in message ... I need to automatically insert a picture in a worksheet depending on certain cell value. e.g. if cell A1=1, picture1 will show in cell B5, if cell A1=2, picture2 will show in cell B5, if cell A1=3, No graphic will show in cell B5. Any help would be greatly appreciated. Thanks |
Automatically insert signature in worksheet
Hi John,
Try: '=================================== Private Sub Worksheet_Calculate() Dim oPic As Picture Dim arr As Variant Dim arr2 As Variant Dim i As Long arr = Array("A1", "D1", "H1") '<<==== CHANGE arr2 = Array("Picture1", "Picture2", "Picture3") '<<==== CHANGE Me.Pictures.Visible = False For i = LBound(arr) To UBound(arr) With Range(arr(i)) Set oPic = Me.Pictures(arr2(i)) oPic.Visible = True oPic.Top = .Top oPic.Left = .Left oPic.Height = .Height oPic.Width = .Width End With Next i End Sub '<<=================================== Change the destination array addresses to suit and change the picture names in arr2 to reflect the three copies of your signature, --- Regards, Norman "John Davies" wrote in message ... Thanks for your help, but can you advise me how I can adapt the code to have the picture show in more than 1 location. Basically the picture is a scanned signature and for example if cell A1=1, the signature needs needs to show up on 3 different sections of the sheet. Thanks "Norman Jones" wrote: Hi John, See JE McGimpsey's approach and downloadable sample workbook at: http://www.mcgimpsey.com/excel/lookuppics.html JE's code could readily be adapted to accord with your requirements. --- Regards, Norman "John Davies" wrote in message ... I need to automatically insert a picture in a worksheet depending on certain cell value. e.g. if cell A1=1, picture1 will show in cell B5, if cell A1=2, picture2 will show in cell B5, if cell A1=3, No graphic will show in cell B5. Any help would be greatly appreciated. Thanks |
Automatically insert signature in worksheet
Hi John,
Additionally, size the signature destination cells to match rge desired sinature dimensions. You can do this manually, or by means of a minor addition to the code. --- Regards, Norman "Norman Jones" wrote in message ... Hi John, Try: '=================================== Private Sub Worksheet_Calculate() Dim oPic As Picture Dim arr As Variant Dim arr2 As Variant Dim i As Long arr = Array("A1", "D1", "H1") '<<==== CHANGE arr2 = Array("Picture1", "Picture2", "Picture3") '<<==== CHANGE Me.Pictures.Visible = False For i = LBound(arr) To UBound(arr) With Range(arr(i)) Set oPic = Me.Pictures(arr2(i)) oPic.Visible = True oPic.Top = .Top oPic.Left = .Left oPic.Height = .Height oPic.Width = .Width End With Next i End Sub '<<=================================== Change the destination array addresses to suit and change the picture names in arr2 to reflect the three copies of your signature, --- Regards, Norman "John Davies" wrote in message ... Thanks for your help, but can you advise me how I can adapt the code to have the picture show in more than 1 location. Basically the picture is a scanned signature and for example if cell A1=1, the signature needs needs to show up on 3 different sections of the sheet. Thanks "Norman Jones" wrote: Hi John, See JE McGimpsey's approach and downloadable sample workbook at: http://www.mcgimpsey.com/excel/lookuppics.html JE's code could readily be adapted to accord with your requirements. --- Regards, Norman "John Davies" wrote in message ... I need to automatically insert a picture in a worksheet depending on certain cell value. e.g. if cell A1=1, picture1 will show in cell B5, if cell A1=2, picture2 will show in cell B5, if cell A1=3, No graphic will show in cell B5. Any help would be greatly appreciated. Thanks |
All times are GMT +1. The time now is 01:40 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com