R
rob p
What is selection.formfields.count? I call this function from a macro on
exit from different checkboxes that are in different cells in a table. It is
supposted to tell me what cell it is. Seems that no matter which checkbox I
exit from - the first time, the count is 1. After that it is 0 and then I
get an error on the name. Here it is:
Function FormfieldName() As Variant
MsgBox "S FF CT " & Selection.FormFields.Count
If Selection.FormFields.Count = 1 Then
FormfieldName = Selection.FormFields(1).Name
ElseIf Selection.FormFields.Count = 0 And Selection.Bookmarks.Count > 0
Then
FormfieldName = Selection.Bookmarks(Selection.Bookmarks.Count).Name
End If
MsgBox FormfieldName
End Function
Thanks.
exit from different checkboxes that are in different cells in a table. It is
supposted to tell me what cell it is. Seems that no matter which checkbox I
exit from - the first time, the count is 1. After that it is 0 and then I
get an error on the name. Here it is:
Function FormfieldName() As Variant
MsgBox "S FF CT " & Selection.FormFields.Count
If Selection.FormFields.Count = 1 Then
FormfieldName = Selection.FormFields(1).Name
ElseIf Selection.FormFields.Count = 0 And Selection.Bookmarks.Count > 0
Then
FormfieldName = Selection.Bookmarks(Selection.Bookmarks.Count).Name
End If
MsgBox FormfieldName
End Function
Thanks.