Quantcast
Viewing all articles
Browse latest Browse all 50123

Standard size while inserting pictures with VBA/macro

Hey guys,

I've got a VBA/maco for auto placing the picture with the standard size:

Height: 1,27 cm
Width: 1,69 cm


The VBA I use is:

Sub test()
Dim myFiles, e
myFiles = Application.GetOpenFilename(, , , , True)
If Not IsArray(myFiles) Then Exit Sub
For Each e In myFiles
With ActiveSheet
With .Pictures.Insert(e)
.Left = Range("b1").Left + 289
.Top = Range("b1").Top + 100
.Height = Range("a2").Height
.Width = Range("a2").Width
End With
End With
Next
End Sub




But now I want the following size for all pictures:

Height: 1,1 cm
Width: 3,38 cm



How can I implement that in the code?

Viewing all articles
Browse latest Browse all 50123

Trending Articles