adding a browse button to copy a path to .jpgs

carrguy01

New Member
Joined
Apr 7, 2011
Messages
42
The program below works well but the pictures that i want to add change on a daily bassis. the work book page is page 4 i am entering data on page 3. The below is the code for sheet 4 and as you can see i have a path location that i copied and pastied into the code. Is there away on page 3 to have a browse button so i can find my jpg. and it will copy the path and then enter it into the code on sheet 4? I hope this makes sense!!


Sub piccy4()
ActiveSheet.Pictures.Insert ("C:\Users\Public\Pictures\work\new4.jpg")
With ActiveSheet.Shapes(ActiveSheet.Shapes.Count)
.LockAspectRatio = False
.Top = Range("b2").Top
.Left = Range("b3").Left
.Height = Range("B2:B9").Height
.Width = Range("B2:d2").Width
End With
ActiveSheet.Pictures.Insert ("C:\Users\Public\Pictures\work\Janice Lewanowski picture.jpg")
With ActiveSheet.Shapes(ActiveSheet.Shapes.Count)
.LockAspectRatio = False
.Top = Range("i2").Top
.Left = Range("i3").Left
.Height = Range("b2:B9").Height
.Width = Range("i2:k2").Width
End With
ActiveSheet.Pictures.Insert ("C:\Users\Owner\Desktop\work\Marketing\Logo.jpg")
With ActiveSheet.Shapes(ActiveSheet.Shapes.Count)
.LockAspectRatio = False
.Top = Range("b12").Top
.Left = Range("b13").Left
.Height = Range("b12:e13").Height
.Width = Range("b2:d2").Width
End With
ActiveSheet.Pictures.Insert ("C:\Users\Public\Pictures\work\373 Pulver Rd. (2110105) open house sun. 2 30-4. $324900.jpg")
With ActiveSheet.Shapes(ActiveSheet.Shapes.Count)
.LockAspectRatio = False
.Top = Range("g17").Top
.Left = Range("g185").Left
.Height = Range("g17:g27").Height
.Width = Range("g17:k14").Width
End With
End Sub
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,224,518
Messages
6,179,248
Members
452,900
Latest member
LisaGo

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