Scripts Property Example

This example adds a new VBScript block to the Scripts collection on the active worksheet.

Set objScrs = ActiveSheet.Scripts
Set objNewScr = objScrs.Add
objNewScr.Language = msoScriptLanguageVisualBasic