What is the syntax to load an image?

<image control name>.Picture = LoadPicture(<file path in string form>)
'examples
profileImg.Picture = LoadPicture("C:\Users\john\Documents\johnsface.jpg")

strPath = "C:\Users\bob\Pictures\Landscapes\picoftrees.jpg"
image1.Picture = LoadPicture(strPath)

 

Helpful Tips

  • To add an Image Control, directly drag an Image from the Toolbox menu onto your UserForm.
  • To change the name of an Image Control, go to the Properties window in the UserForm Editor and change the name under field “(Name)”.
  • If you do not see your Toolbox or Properties window, go to the top under View and toggle your visibility settings
  • To find the string filepath for your image, you may find this article helpful: How do I find the filepath for a folder?

What is the syntax to add a hyperlink to cell?

Sheets(“<sheet name>”).Hyperlinks.Add Range(“<cell reference>”), “<http://www.yourwebsite.com>
'examples
Sheets(“resourceSheet”).Hyperlinks.Add Range(“B2”), “http://www.mysyntaxvba.wordpress.com”
ActiveSheet.Hyperlinks.Add Range(“B2”), “http://www.mysyntaxvba.wordpress.com”

Default formatting for hyperlinks on Excel is a blue text with a blue underline.

What is the syntax for adding a worksheet?

'to add a sheet at the very beginning of the Sheets tab
Worksheets.Add Before:=Worksheets(1)

'to add a sheet at the very beginning of the Sheets tab
Dim shtLast As Worksheet
Set shtLast = .Worksheets(.Worksheets.Count)
Set shtNew = Worksheets.Add(After:=shtLast)

'to add multiple sheets before the active sheet
ThisWorkbook.Worksheets.Add Count:=<number of sheets you want to add>

'to add a new sheet before the current active sheet
Dim sht as Worksheet
Set sht = ThisWorkbook.Worksheets.Add
sht.Name = "<name of new worksheet>"