rgr
04-01-2006, 07:28 AM
I have a userform named PlayerEntryForm.
Here's the code to open it:
Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim ws As Worksheet
Dim player1 As Range
Dim player2 As Range
Dim player3 As Range
Dim player4 As Range
Set player1 = Range("B5:B36")
Set player2 = Range("D5:D36")
Set player3 = Range("H5:H36")
Set player4 = Range("J5:J36")
Set ws = Sheet1
For Each Target In Selection
If Application.Intersect(Selection, player1) Is Nothing _
And Application.Intersect(Selection, player2) Is Nothing _
And Application.Intersect(Selection, player3) Is Nothing _
And Application.Intersect(Selection, player4) Is Nothing Then
MsgBox "Select Partnership Cell"
Else
PlayerEntryForm.Show
End If
Next
End Sub
Every time I test it I get "method range of object _global failed", which pinpoints the userform.
I''ve tried declaring it, loading it, same error, can some one help me please?
Here's the code to open it:
Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim ws As Worksheet
Dim player1 As Range
Dim player2 As Range
Dim player3 As Range
Dim player4 As Range
Set player1 = Range("B5:B36")
Set player2 = Range("D5:D36")
Set player3 = Range("H5:H36")
Set player4 = Range("J5:J36")
Set ws = Sheet1
For Each Target In Selection
If Application.Intersect(Selection, player1) Is Nothing _
And Application.Intersect(Selection, player2) Is Nothing _
And Application.Intersect(Selection, player3) Is Nothing _
And Application.Intersect(Selection, player4) Is Nothing Then
MsgBox "Select Partnership Cell"
Else
PlayerEntryForm.Show
End If
Next
End Sub
Every time I test it I get "method range of object _global failed", which pinpoints the userform.
I''ve tried declaring it, loading it, same error, can some one help me please?