[英]Alert if empty cell found in power point tables and in which slide using vba
I have to find and alert that if empty cell found in each tables in power point.我必须找到并提醒,如果在电源点的每个表格中发现空单元格。
I have found the below code here , but it does not work and it should not be find for all table, not for selected one.我在这里找到了下面的代码,但它不起作用,不应该为所有表找到它,而不是为选定的一个。
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
Please anyone help me for this.请任何人帮助我。
This code loops through each slide in the active presentation, and in each slide, check whether the each shape on the slide contains a table, and if it does, checks whether each cell is blank.此代码循环播放活动演示文稿中的每张幻灯片,并在每张幻灯片中检查幻灯片上的每个形状是否包含表格,如果包含,则检查每个单元格是否为空白。 Cheers.干杯。
Sub CheckTableCells()
Dim vSlide As Slide
Dim vShape As Shape
Dim vRow As Long
Dim vColumn As Long
For Each vSlide In Application.ActivePresentation.Slides
For Each vShape In vSlide.Shapes
If vShape.HasTable Then
For vRow = 1 To vShape.Table.Rows.Count
For vColumn = 1 To vShape.Table.Columns.Count
If vShape.Table.Cell(vRow, vColumn).Shape.TextFrame.TextRange.Text = "" Then
MsgBox vSlide.Name & " Table: """ & vShape.Name & """ cell (" & vRow & "," & vColumn & ") is blank."
End If
Next
Next
End If
Next
Next
End Sub
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.