Browse All Commands

What is the syntax to open a userform?

<userform name>.Show
'example
frmHome.Show

 

Advertisements

What is the syntax to format number output?

 Format(<value>, "<formatting convention>")
'example - outputs 2
decimalNum = 2.31321
Msgbox Format(decimalNum, "0")

 

What is the syntax to retrieve all open workbooks in Excel?

'wb.Name holds the name of the open workbook
Dim wb As Workbook
For Each wb In Application.Workbooks
 <code here with involving wb.Name>
Next wb
'example
Dim wb As Workbook
For Each wb In Application.Workbooks 'for each open workbook, pass the name to lookupEGA()
   MsgBox wb.Name
   lstWorkbooks.AddItem wb.Name
Next wb