Alex Piotto
Board Regular
- Joined
- Jul 5, 2016
- Messages
- 82
- Office Version
- 2007
- Platform
- Windows
Hi EXCELlent people!
I am working on a recipes workbook and I need to ask for your help in order to retrieve an image (shape) from a sheet and show it into another one.
I'll explain... I have a sheet with a "database" containing the name, category, author, ingredients, preparation, date inserted and a photo of each recipe.
I inserted all the data in the sheet via userform.
So I have a nice long list of recipes, one per row, with a photo for each recipe in the last column (column 7 or G).
I am already able to get all the values of each recipe in another sheet into textboxes, calling from a populated combobox dropdown list with the recipes names.
But I can't figure out how to get the right photo for each recipe when showing the data.....
Until now I can only show the first photo.... how can I get the right picture for every recipe I'll call from the combobox?
Any help will be really appreciated.
I am working on a recipes workbook and I need to ask for your help in order to retrieve an image (shape) from a sheet and show it into another one.
I'll explain... I have a sheet with a "database" containing the name, category, author, ingredients, preparation, date inserted and a photo of each recipe.
I inserted all the data in the sheet via userform.
So I have a nice long list of recipes, one per row, with a photo for each recipe in the last column (column 7 or G).
I am already able to get all the values of each recipe in another sheet into textboxes, calling from a populated combobox dropdown list with the recipes names.
But I can't figure out how to get the right photo for each recipe when showing the data.....
Code:
Private Sub selectrecipe_Change()
Dim msn As String
Dim msnFound As Range
msn = selectrecipe
With Sheets("RECIPESDATABASE")
Set msnFound = .Columns(1).Find(What:=msn, LookIn:=xlValues, Lookat:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
Worksheets("Sheet1").author.Value = msnFound.Offset(, 2).Value
Worksheets("Sheet1").ingredients.Value = Replace(msnFound.Offset(, 3).Value, vbCrLf, "")
Worksheets("Sheet1").preparation.Value = Replace(msnFound.Offset(, 4).Value, vbCrLf, "")
Worksheets("Sheet1").dateinserted.Value = Format(msnFound.Offset(, 5).Value, "dd-mm-yy")
Worksheets("Sheet1").photorecipe.Picture = Worksheets("RECIPESDATABASE").Image1.Picture 'photorecipe is the name of the image control in sheet1
End With
End Sub
Until now I can only show the first photo.... how can I get the right picture for every recipe I'll call from the combobox?
Any help will be really appreciated.