![]() |
|
#4
|
|||
|
|||
|
I am searching for a heading in a table and I need to modify it if it's not in the first 2 rows.
I can't (and don't want to) loop through the entire table. I just need to find out if the cell I found is in rows 1-2 or not. Code:
While Selection.Find.Found
If Selection.Information(wdWithInTable) Then
Set oTable = Selection.Tables(1)
iRow = Selection.Rows(1).Index
If iRow > 2 Then
Do something....
End If
End If
Selection.Collapse Direction:=wdCollapseEnd
Selection.Find.Execute
Wend
I tried to access Selection.Range.Cells(1).RowIndex - but I get the same exception. Thanks for your help, Rocky |
| Tags |
| tables;formula;automating |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
How to vertically align a merged cell to fit text
|
paik1002 | Excel | 6 | 09-20-2016 03:00 AM |
| Combining 2 tables into 1 and use Table2's column widths (hoping for workaround dealing merged cells | CodingGuruInTraining | Word VBA | 24 | 10-07-2015 07:48 PM |
Table will not allow sorting because "cells are merged". I can't find the merged cells.
|
wendyloooo | Word Tables | 1 | 05-26-2015 01:19 PM |
Unable to vertically center align texts in table cells?
|
tinfanide | Word | 3 | 11-24-2013 06:37 AM |
| How to merge matching cells vertically? | Odiseh | Excel | 1 | 01-02-2010 02:41 PM |