ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   select picture with list (https://www.excelbanter.com/excel-programming/445390-select-picture-list.html)

kalpesh

select picture with list
 
Hello,

in sheet1

contain customer name & i create a list of customer name

a1 cell contain list

now ,

i select name of customer in list, photo of customer is shwon in b1 cell

please vba help or macro for this

Don Guillett[_2_]

select picture with list
 

This can be done. Here there is a dropdown in a1 tied to this macro in
you SHEET module.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
Dim Shp As Shape
On Error GoTo PictureNotFound
Worksheets("Sheet1").Shapes(Me.Range("A1").Value). Copy
'Worksheets("Sheet1").Shapes("don1").Copy

'Delete the previous picture
For Each Shp In Me.Shapes
If Shp.Type = msoPicture Then
If Shp.TopLeftCell.Address = "$C$1" Then
If Shp.Name < Range("A1").Value Then Shp.Delete
End If
End If
Next
Worksheets("Sheet2").Paste
With Selection
.Name = Range("A1").Value
.Top = Range("C1").Top
.Left = Range("C1").Left
End With
Range("A1").Select
Exit Sub
PictureNotFound: MsgBox "Picture not found!" & vbNewLine _
& "Check Name."
End If
End Sub




On Feb 16, 12:53*am, kalpesh
wrote:
Hello,

*in sheet1

*contain customer name & i create a list of customer name

*a1 cell contain list

*now ,

*i select name of customer in list, photo of customer is shwon in b1 cell

*please vba help or macro for this




All times are GMT +1. The time now is 10:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com