Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-04-2022, 07:44 AM
Denalei Denalei is offline VBA Word : identify empty cell and aply specific format Windows 10 VBA Word : identify empty cell and aply specific format Office 2019
Novice
VBA Word : identify empty cell and aply specific format
 
Join Date: Jan 2022
Posts: 2
Denalei is on a distinguished road
Default VBA Word : identify empty cell and aply specific format

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,
Reply With Quote
 

Tags
table, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA Word : identify empty cell and aply specific format Need formula to format one cell if another cell includes specific text 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
VBA Word : identify empty cell and aply specific format Delete cell content that has a specific format Daniel Arbeit Excel Programming 1 06-20-2016 03:02 PM
VBA Word : identify empty cell and aply specific format Get next non empty cell from a specific list with VBA chriss17 Excel Programming 2 06-15-2016 08:40 AM
VBA Word : identify empty cell and aply specific format Way to identify what image format has been inserted in PPT? Pantucci PowerPoint 1 08-20-2010 12:03 AM

Other Forums: Access Forums

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