Option
Explicit
Public
Sub
ShowHeader()
If
ActiveSheet
Is
Nothing
Then
Exit
Sub
If
Not
TypeOf
ActiveSheet
Is
Excel.Worksheet
Then
Exit
Sub
Dim
shp
As
Excel.Shape
Select
Case
TypeName(Application.Caller)
Case
"String"
On
Error
Resume
Next
Set
shp = ActiveSheet.Shapes(Application.Caller)
On
Error
GoTo
0
End
Select
If
shp
Is
Nothing
Then
Exit
Sub
If
shp.Type <> msoFormControl
Then
Exit
Sub
If
shp.FormControlType <> xlButtonControl
Then
Exit
Sub
Dim
rngHeaderCell
As
Excel.Range
With
ActiveSheet.Columns(
"A"
)
Set
rngHeaderCell = .Find(shp.OLEFormat.
Object
.Caption, LookIn:=xlValues, LookAt:=xlWhole)
If
rngHeaderCell
Is
Nothing
Then
Call
MsgBox(
"Die Überschrift '"
& shp.OLEFormat.
Object
.Caption &
"' wurde nicht gefunden."
, _
vbExclamation)
Else
rngHeaderCell.Activate
End
If
End
With
End
Sub