![]() |
#1
|
|||
|
|||
![]()
Hello everyone
Thank you in advance for your help. First of all, sorry for my english, if something ist not clear please ask. I'm a beginner in VBA (and i usually work with excel) System : Windows 10 Version : Word 2019 I have 30+ tables in a word document. I need to select all empty cells an aply a specific format (for example "standard1") The reason : I didn't pay attention to the formats while creating the table, my bad. And now there are many different formats applied to the empty cells. Find and select doesn't work, because the cells are empty. I found this macro (is there a way to twist it the way i need it?) I replace the MsgBox with : Selection.Style = ActiveDocument.Styles("standard1") And it seem to work up to the first cell with text. Sub CheckTableCells() Dim oCell As Cell Dim oRow As Row Dim MyRange As Range For Each oRow In Selection.Tables(1).Rows For Each oCell In oRow.Cells If Selection.Text = Chr(13) & Chr(7) Then oCell.Select MsgBox oCell.RowIndex & " " & oCell.ColumnIndex & " is empty." End If Next oCell Next oRow End Sub I wish a happy new year to everyone, |
Tags |
table, vba |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Bigsur2 | Excel | 2 | 11-17-2022 11:53 AM |
How do I test a cell for a specific word if the cell has a drop down list. | RoehamptonTech | Excel | 1 | 08-23-2017 05:05 AM |
![]() |
Daniel Arbeit | Excel Programming | 1 | 06-20-2016 03:02 PM |
![]() |
chriss17 | Excel Programming | 2 | 06-15-2016 08:40 AM |
![]() |
Pantucci | PowerPoint | 1 | 08-20-2010 12:03 AM |