Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 12-20-2016, 01:08 AM
rocky2 rocky2 is offline Overcome issues in tables with vertically merged cells Windows 10 Overcome issues in tables with vertically merged cells Office 2013
Novice
Overcome issues in tables with vertically merged cells
 
Join Date: Feb 2016
Posts: 25
rocky2 is on a distinguished road
Default This is what I used

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
the exception I get is run-time error 5991: Cannot access individual rows in this collection because the table has vertically merged cells.

I tried to access Selection.Range.Cells(1).RowIndex - but I get the same exception.

Thanks for your help,
Rocky
Reply With Quote
 

Tags
tables;formula;automating



Similar Threads
Thread Thread Starter Forum Replies Last Post
Overcome issues in tables with vertically merged cells 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
Overcome issues in tables with vertically merged cells 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
Overcome issues in tables with vertically merged cells 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

Other Forums: Access Forums

All times are GMT -7. The time now is 10:46 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft