Alex Piotto
Board Regular
- Joined
- Jul 5, 2016
- Messages
- 82
- Office Version
- 2007
- Platform
- Windows
Hi everybody!
I am trying to pass some data and an image from a userform to another sheet.
Everything seems to work fine, all data go in the right place in the other sheet, but instead of the picture, I get a number in the cell!
What am I doing wrong?
Here is the part of code concerned...
Any help will be really appreciated.
I am trying to pass some data and an image from a userform to another sheet.
Everything seems to work fine, all data go in the right place in the other sheet, but instead of the picture, I get a number in the cell!
What am I doing wrong?
Here is the part of code concerned...
Code:
RowCount = Worksheets("RICETTEDATABASE").Range("A1").CurrentRegion.Rows.count
With Worksheets("RICETTEDATABASE").Range("A1")
.Offset(RowCount, 0).Value = Me.txtRicetta.Value
.Offset(RowCount, 1).Value = Me.comboCategoria.Value
.Offset(RowCount, 2).Value = Me.txtAutore.Value
.Offset(RowCount, 3).Value = Replace(Me.txtLista.Value, Chr(13), "")
.Offset(RowCount, 4).Value = Replace(Me.txtPreparazione.Value, Chr(13), "")
.Offset(RowCount, 5).Value = Format(Now, "dd/mm/yyyy")
Dim Pict As String
Pict = Me.fotoAddress.Value
Dim Picto As Long
Picto = LoadPicture(Pict)
If Pict <> "" Then
.Offset(RowCount, 6).Value = Picto 'here I get a number... no picture!
Else
Dim picta As Shape
Set picta = Worksheets("Apertura").Shapes("LOGOTIPO")
picta.Copy
.Offset(RowCount, 6).PasteSpecial
End If
End With