Announcement

Collapse
No announcement yet.

Pop-up boxes that require input from user

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Hi Bill,

    I've been having some difficulty using the code you posted on this thread about how to fire up a macro when you double click on a particular cell.
    This was the code:

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    Dim rRange As Range
    Set rRange = Sheet1.Range("D4")
    If Target <> Range("D4") Then Exit Sub
    If Not Intersect(Target, rRange) Is Nothing Then
    AddFormula

    End If
    End Sub

    I'm having probelms with this bit:

    If Not Intersect(Target, rRange) Is Nothing Then
    AddFormula

    I replaced AddFormula with a simple instruction, but got Run time error 1004: Method 'Intersect' of object '_Global' failed.

    Do you know why this is?

    Cheers
    Johno

    Comment


    • #17
      Hi Johno,

      Try removing the Sheet1. from the line:

      Set rRange = Sheet1.Range("D4")

      Then it won't matter what sheet you are on. I can't see any reason why it should not work for you.

      Regards,

      Bill

      Comment


      • #18
        Try
        Code:
        Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
            If Not Intersect(Target, Range("D4")) Is Nothing Then
                Cancel = True
                AddFormula
            End If
        End Sub
        What is "AddFormula" another Procedure?

        Comment


        • #19
          Cheers guys. Up and running!
          Johno

          Comment

          Working...
          X