Hi all,
I've made a form to act as a billing invoice for when my team carry out a response process at Gatwick Airport. Its a simple drop down system but I'd like the user of the form to be able to add photos as evidence of the issue that we attended (the companies we will bill will argue that the issue wasn't there / or their responsibility). The form will be filled in and then will be saved as a worksheet and exported as a PDF.
I've found some vba coding on these forums that works well - opening a selection folder and when the picture is added it all attaches fine to the specified area on the sheet. I'd like to be able to add multiple photos (up to three in total) but the vba I've found only puts the picture in to the pre defined area "C8" and on another press just puts another photo over the top of the first. Is there any way that the vba can be coded so that on a second and third press / photo entry it would move on to another area of the worksheet? Ie: 1st photo in C8, 2nd photo in C20, 3rd photo in C32?
As always your help is greatly appreciated.
Trevor
The vba I'm using is .....
I've made a form to act as a billing invoice for when my team carry out a response process at Gatwick Airport. Its a simple drop down system but I'd like the user of the form to be able to add photos as evidence of the issue that we attended (the companies we will bill will argue that the issue wasn't there / or their responsibility). The form will be filled in and then will be saved as a worksheet and exported as a PDF.
I've found some vba coding on these forums that works well - opening a selection folder and when the picture is added it all attaches fine to the specified area on the sheet. I'd like to be able to add multiple photos (up to three in total) but the vba I've found only puts the picture in to the pre defined area "C8" and on another press just puts another photo over the top of the first. Is there any way that the vba can be coded so that on a second and third press / photo entry it would move on to another area of the worksheet? Ie: 1st photo in C8, 2nd photo in C20, 3rd photo in C32?
As always your help is greatly appreciated.
Trevor
The vba I'm using is .....
VBA Code:
Sub GetPic()
Dim fNameAndPath As Variant
Dim img As Shape
fNameAndPath = Application.GetOpenFilename(Title:="Select Picture To Be Imported")
If fNameAndPath = False Then Exit Sub
Set img = ActiveSheet.Shapes.AddPicture(Filename:=fNameAndPath, _
LinkToFile:=False, SaveWithDocument:=True, _
Left:=1, Top:=1, Width:=-1, Height:=-1)
With img
'Resize Picture to fit in the range....
.Left = ActiveSheet.Range("C8").Left
.Top = ActiveSheet.Range("C8").Top
.Width = ActiveSheet.Range("C8:G8").Width
.Height = ActiveSheet.Range("C8:C18").Height
.Placement = 1
.DrawingObject.PrintObject = True
End With
End Sub