VBA - Adding an Image to a UserForm

K

K. Georgiadis

I'm confused about the procedure for inserting an Image
(e.g., clipart) to a UserForm in Visual Basic Editor.
Could someone help me with this VBA 1.01 topic?
 
G

Guest

This is the code that I use to insert a image to Excel...
Worksheets("ALBURY").Activate
Range("O5").Select ' first cell with value to be copied
While ActiveCell.Formula said:
' ******* Checking for 0 values and not print
*********

If ActiveCell.Value <> "0" Then

'
************************************************
' "transfer" values
Worksheets("Sheet1").Range("D1").Formula =
ActiveCell.Offset(0, 0).Value
MyVar1 = ActiveCell.Offset(0, 1).Value
MyVar2 = ActiveCell.Offset(0, 2).Value
MyVar3 = ".jpg" 'ActiveCell.Offset
(0,3).Value

MyVar = MyVar1 + MyVar2 + MyVar3

Range("A2").Select
ActiveSheet.Pictures.Insert(MyVar).Select

It's grabbing the file name from 2 cells (MyVar1 and My
Var2) then inserting to the selection.

Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top