Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 1.31 KB

Publisher.Cell.Row.md

File metadata and controls

54 lines (40 loc) · 1.31 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Cell.Row property (Publisher)
vbapb10.chm5111831
vbapb10.chm5111831
Publisher.Cell.Row
b961af2b-6b03-f54b-922e-d2e7633a3dfe
06/06/2019
medium

Cell.Row property (Publisher)

Returns a Long that represents the row number containing the specified cell. Read-only.

Syntax

expression.Row

expression A variable that represents a Cell object.

Example

This example enters the fill for all even-numbered rows and clears the fill for all odd-numbered rows in the specified table. This example assumes that the specified shape is a table and not another type of shape.

Sub FillCellsByRow() 
 Dim shpTable As Shape 
 Dim rowTable As Row 
 Dim celTable As Cell 
 
 Set shpTable = ActiveDocument.Pages(1).Shapes _ 
 .AddTable(NumRows:=5, NumColumns:=5, Left:=100, _ 
 Top:=100, Width:=100, Height:=12) 
 For Each rowTable In shpTable.Table.Rows 
 For Each celTable In rowTable.Cells 
 If celTable.Row Mod 2 = 0 Then 
 celTable.Fill.ForeColor.RGB = RGB _ 
 (Red:=180, Green:=180, Blue:=180) 
 Else 
 celTable.Fill.ForeColor.RGB = RGB _ 
 (Red:=255, Green:=255, Blue:=255) 
 End If 
 Next celTable 
 Next rowTable 
 
End Sub

[!includeSupport and feedback]