I use a userform to select an area containing data which is manipulated in various ways.
I do something like this to get the area:
If Selection.Cells.Count = 1 Then
Set rng = ActiveCell.CurrentRegion
Else
Set rng = Selection.Range
End If
MyDialog.SourceRange.Value = rng.Address
MyDialog.TableHasHeaders.Value = True
The userform has a tickbox called "My table has headers" set to True
by default. I would like to control the default value of this tickbox using the same logic that Excel uses to control the default value of the tickbox with the same name that is shown when I click the Insert -> Table
menu button.
I don't mind whether I show the built-in dialog and access the values of its fields or whether I call the function that controls the built-in tick box. Are either of these two things possible and if so, how?