如果在电源点表中发现空单元格以及使用 vba 在哪张幻灯片中发现空单元格,则发出警报 [英] Alert if empty cell found in power point tables and in which slide using vba
本文介绍了如果在电源点表中发现空单元格以及使用 vba 在哪张幻灯片中发现空单元格,则发出警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果在电源点的每个表格中发现空单元格,我必须查找并提醒.
我在
解决方案
此代码循环播放当前演示文稿中的每张幻灯片,并在每张幻灯片中检查幻灯片上的每个形状是否包含表格,如果包含,检查每个单元格是否为空.干杯.
Sub CheckTableCells()将 vSlide 调暗为幻灯片将 vShape 调暗为形状将 vRow 调暗至长将 vColumn 调暗至长对于 Application.ActivePresentation.Slides 中的每个 vSlide对于 vSlide.Shapes 中的每个 vShape如果 vShape.HasTable 那么对于 vRow = 1 到 vShape.Table.Rows.Count对于 vColumn = 1 到 vShape.Table.Columns.Count如果 vShape.Table.Cell(vRow, vColumn).Shape.TextFrame.TextRange.Text = "" 然后MsgBox vSlide.Name &" 表: """ &vShape.Name &""" 单元格 (" & vRow & "," & vColumn & ") 为空.万一下一个下一个万一下一个下一个结束子
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
这篇关于如果在电源点表中发现空单元格以及使用 vba 在哪张幻灯片中发现空单元格,则发出警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文