问题描述
首先,我应该注意到我对此非常陌生。我正在尝试将adobe pdf中的问卷导出到excel中,然后创建一个公式/宏来确定检查哪个形状(或者在excel中它只是显示为实心填充的形状)然后快速计算
结果来自形式而不是手工。
First off, I should note I am VERY new to this. I am trying to export a Questionnaire in adobe pdf into excel and then create a formula/macro to identify which shape is checked (or in excel it just shows as a solid filled shape) to then quickly calculate the results from the form rather than by hand.
我找到了将数字转换为形状的代码,但我无法弄清楚如何编写代码来判断是否填充了形状名称(shape32)。并且如果填充以在不同的单元格中插入数字。任何帮助将不胜感激。谢谢!
I have found code for changing a number into a shape, but I can't figure out how to write code to tell if shape name ex.(shape32) is filled or not. And if it is filled to insert a number in a different cell. Any help would be greatly appreciated. Thanks!
推荐答案
Range("A1").Value = ""
' ---
Dim shp As Shape
Dim shpName As String
For Each shp In ActiveSheet.Shapes
If (shp.Name = "shape32") Then
If (shp.Fill.Type <> -2) Then
MsgBox "shape32: filled"
Range("A1").Value = shp.Name
Else
MsgBox "shape32: Not filled"
Range("A1").Value = "Not filled"
End If
End If
Next
如果shape.Fill.Type为-2,则不填充。
问候,
if shape.Fill.Type is -2, it is not filled.
Regards,
这篇关于固体填充形状与无填充形状的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!