Insert picture with cell value

aguskwzwqyi

New Member
Joined
Nov 7, 2013
Messages
4
how to insert a picture from souce cell and store it to another cell and save with the document (not just a link) using vba userform

example
in sheet1 cell b9 to b200 i have a name of an animal and i must store it in excell file in sheet2 cell a5, b5, a7 b7 and so on because i skip one cell for numbering (a6,b6 a8,b8 and so on) assuming i have the picture of that animal in folder "D:\OneDrive\Desktop\animal"
VBA Code:
Private Sub btn_set_Click()
Dim animal_folder As String
Dim animal_name As String
Dim animal As Pictures
Set wksheet = Sheet1
Set aktif_sheet = Worksheets("Sheet3")
Set animal_folder = "D:\OneDrive\Desktop\animal" & Sheet1(2, 9).End(xlUp).Rows.Value & ".jpg"
    end_row = aktif_sheet.Cells(Rows.Count, 1).End(xlUp).Rows + 1
    aktif_sheet.Cells(end_row, 2) = animal_folder
End Sub

i have wrote code like this but give error object required btw im new at vba that code i write, i get it from searching trough internet.

the cell used for refference that image was like this.

Book1
AB
5NOANIMAL NAME
61
72
83
94
105
116
127
138
149
1510
1611
1712
Sheet1


and this is place i sore the animal pictures
Book1
AB
8
912
10
1134
12
1356
14
1578
16
17910
18
191112
Sheet2
Cell Formulas
RangeFormula
A11,A19,A17,A15,A13A11=B9+1
B11,B19,B17,B15,B13B11=A11+1
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Hi!
This sounds like a fun project lol
would you care to share your resources(images)? I'll be happy to give this a go.
 
Upvote 0

Forum statistics

Threads
1,215,326
Messages
6,124,258
Members
449,149
Latest member
mwdbActuary

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top