DIAdem Help

Property: Count for Sheets

  • Updated2024-09-12
  • 1 minute(s) read

Property: Count for Sheets

Returns the number of worksheets in a workbook.

Object.Count
ObjectSheets
Object with this property
Object.CountLongInteger with read access

The following example generates for each worksheet a new channel group. The channel group receives the name of the worksheet and a property which retains the position of the worksheet in the workbook.

Dim i, oCurrSheet, oNewGroup
For i = 1 to Workbook.Sheets.Count
  Set oCurrSheet = Workbook.Sheets(i)
  Set oNewGroup = Root.ChannelGroups.Add(oCurrSheet.Name)
  Call NewGroup.Properties.Add("Description", "Sheet"&oCurrSheet.Index)
Next