habe vor ein paar Tagen hier eine Userform bekommen. Funktioniert auch einwandfrei.
Nun startet sie automatisch sobald ich die Mappe aufmache, egal welches Tab, dass ist nicht schön,
Gibt es eine Möglichkeit das sie nur sichtbar wird, wenn ich in die dafür vorgesehene Tabs bin, und die richtige Zelle(n) A21:A41 anklicke? Diese Formel habe ich in dem Tabellenblatt stehen.
Option Explicit
Private Declare Function GetCursorPos Lib "user32.dll" ( _
lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim myCursorPos As POINTAPI
GetCursorPos myCursorPos
If Not Intersect(Target, Range("a21:a41")) Is Nothing Then
With UserForm1
.StartUpPosition = 0
.Left = myCursorPos.x / 1.345
.Top = myCursorPos.y / 1.345
.Show
End With
Cancel = True
End If
End Sub
Mfg Angela