ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to count the cells in a table row ? (https://www.excelbanter.com/excel-programming/358476-how-count-cells-table-row.html)

Alex St-Pierre

How to count the cells in a table row ?
 
Hi,
Does anyone know how to count the cells inside a table row ?
I already tried the following but, (because of merged cells), doesn't work
all the time. Is there an other way to count the cells in a row?

The following two methods doesn't work all the time:
iCount = Tables(1).Rows(1).Cells.Count
or
Dim oCell as Cell
Set oCell = Tables(1).Cells(1,1)
Do Until oCell.RowIndex = 4
oCell.Next
iCount = iCount + 1
Loop
--
Alex St-Pierre

Alex St-Pierre

How to count the cells in a table row ?
 
Oopss.. sorry, this message was for Word.Programming
I will post it there..
--
Alex St-Pierre


"Alex St-Pierre" a écrit :

Hi,
Does anyone know how to count the cells inside a table row ?
I already tried the following but, (because of merged cells), doesn't work
all the time. Is there an other way to count the cells in a row?

The following two methods doesn't work all the time:
iCount = Tables(1).Rows(1).Cells.Count
or
Dim oCell as Cell
Set oCell = Tables(1).Cells(1,1)
Do Until oCell.RowIndex = 4
oCell.Next
iCount = iCount + 1
Loop
--
Alex St-Pierre



All times are GMT +1. The time now is 02:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com