<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%> truter.biz - London news + IT in London + Lester Truter truter.biz Lester Truter; Business Objects;Lotus Notes; Domino; CLP :: Excel VBA ::

In Excel, Click on Tools - Macro - Visual Basic Editor (or press Alt + F11)

You now have access to programmatic control which is more powerful than functions in Excel. Using Visual Basic, you can control the behaviour of all aspects of your workbook.

 

How to make a worksheet hidden so that you can only accces it from the VBA module

Use the following code:

Sheets("Sheet1").Visible = xlVeryHidden

When you want to Unhide it, use:

Sheets("Sheet1").Visible = True

 

How to remove a userform

If the userform is called frmNewLease use:

ThisWorkbook.VBProject.vbcomponents.Remove

ThisWorkbook.VBProject.vbcomponents("frmNewLease")

 

Turn off prompting (e.g. Do you want to save the changes you made to 'Book1')

Use the following code:

Application.DisplayAlerts = False

To enable it again use the True option