Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 10-25-2021, 01:26 AM
gmayor's Avatar
gmayor gmayor is offline Vba: Selecting table cells by fill colour Windows 10 Vba: Selecting table cells by fill colour Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Try the following


Code:
Sub Macro1()
Dim i As Long
Dim oTable As Table
    For Each oTable In ActiveDocument.Tables
        For i = oTable.Rows.Count To 1 Step -1
            If oTable.Cell(i, 1).Shading.BackgroundPatternColor = &HCCFF00 Or _
               oTable.Cell(i, 1).Shading.BackgroundPatternColor = &HB2B2B2 Then
                oTable.Rows(i).Delete
            End If
        Next i
        DoEvents
    Next oTable
    Set oTable = Nothing
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
 

Tags
fill colour, table cell



Similar Threads
Thread Thread Starter Forum Replies Last Post
Vba: Selecting table cells by fill colour New table line has some cells fill colour change trevorc Excel 2 06-30-2021 12:27 PM
Text box fill colour changes when pasted to new file ParishPete Publisher 0 06-21-2019 12:47 AM
In Excel 2007-After Selecting Visibe Cells-How do I "Copy to Visible cells" Only mag Excel 0 10-28-2012 08:04 PM
How to fill a font colour to a particular data appear so many times in a column? PRADEEPB270 Excel 0 03-22-2012 02:04 AM
Accessibility Display & Colour Fill in Shapes thorn Office 0 08-11-2011 07:58 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:29 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