MkDir ("<filepath here>")
'example 'creates a folder called "newfolder" in the current Documents folder MkDir ("C:\Users\Portia\Documents\newfolder")
To determine the filepath of a folder, click here.
MkDir ("<filepath here>")
'example 'creates a folder called "newfolder" in the current Documents folder MkDir ("C:\Users\Portia\Documents\newfolder")
To determine the filepath of a folder, click here.
Dim FSo Dim sFolder As String sFolder = “<filepath for the folder you want to create>” Set FSO = CreateObject(“Scripting.FileSystemObject”) If Not FSO.FolderExists(sFolder)Then FSO.CreateFolder(sFolder) MsgBox(“Folder Created”) Else MsgBox(“Folder already Exists”) End If
To learn how to find a folder’s filepath, click here.
Dim sHLink As String SHLink = “mailto:<recipient’s email address>?subject=<subject line here>&body=<body message here>” ActiveWorkbook.FollowHyperlink(SHLink)
‘example Dim sHLink As String sHLink = mailto:youremail@gmail.com?subject=Sample Subject Line&body=Hello ActiveWorkbook.FollowHyperlink(SHLink)
Workbooks.Add ActiveWorkbook.SaveAs “<C:\insertYourFilePathHere\<name for your new workbook>.xls>”
‘example that creates a new workbook called myWorkbook in the Downloads Folder Workbooks.Add ActiveWorkbook.SaveAs "C:\Users\glestrade\Downloads\myWorkbook.xls"
To find a file path for a file, click here.
Private Function <your name> () ‘your code here ‘callable only by procedures in the same module End Function Public Function <your name> () ‘callable from any procedure End Function Private Sub <your name> () ‘callable only by procedures in the same module ‘cannot be called from Macros dialog box End Sub Public Sub <your name> () ‘callable from any procedure of any module ‘can run procedure from Macros dialog box End Sub