DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to detemine the row and column count of a table

Hello,

 

How Can I detemine the row and column count of a table which is already existing in a Report?

 

 

Regards

0 Kudos
Message 1 of 3
(3,724 Views)

Hello Sarry,

 

Please try d2TabRow and d2TabCol

 

Greetings

Walter

0 Kudos
Message 2 of 3
(3,722 Views)

Hi Sarry,

 

If you meant the total number of rows and columns in a table, here's your best approach:

 

TableName = "2D-TableName"
Set Sheet = Report.Sheets(1)
IF Sheet.Objects.Exists(TableName) THEN
  Set Table = Sheet.Objects(TableName)
  Cols = Table.Columns.Count
  Set Settings = Table.Settings.IndexSettings
  RowStart = Settings.IndexBegin
  RowStop  = Settings.IndexEnd
  Rows = RowStop - RowStart + 1
  MsgBox "Rows = " & Rows & vbCRLF & "Cols = " & Cols
ELSE
  MsgBox "Could not find Table """ & TableName & """"
END IF

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 3 of 3
(3,708 Views)