VBA - Adding an Image to a UserForm

  • Thread starter Thread starter K. Georgiadis
  • Start date Start date
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?
 
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.
 
Back
Top