Results 1 to 9 of 9

Record ActiveCell Location prior to cell movement

Threaded View

  1. #1
    Forum Contributor
    Join Date
    01-09-2009
    Location
    Cedar Hill, Tx
    MS-Off Ver
    Excel 2003
    Posts
    200

    Record ActiveCell Location prior to cell movement

    I'm having a problem with the beforeDoubleClick routine below:

    Private Sub worksheet_beforeDoubleClick(ByVal Target As Range, cancel As Boolean)
        Dim doReturn As Boolean
        doReturn = False
        ActiveWorkbook.Names.Add Name:="rms", RefersToR1C1:= _
            ActiveCell
        With Target
            If Not Intersect(.Cells, Me.Range("aq2:aq3")) Is Nothing Then
                doReturn = True
                If LCase(.Value) = False Then
                    .Value = True
                Else
                    .Value = False
                End If
            End If
            If Not Intersect(.Cells, Me.Range("at2:at24")) Is Nothing Then
                doReturn = True
                Call selectRoute
            End If
            If Not Intersect(.Cells, Me.Range("bd5:bd17")) Is Nothing Then
                doReturn = True
                Call selectSchool
            End If
            If doReturn Then
                Application.Goto reference:="rms"
            End If
        End With
        ActiveWorkbook.Names("rms").Delete
    End Sub
    I want it to record where the cursor is and place the range name "rms" in that location. Then it should evaluate the double-click location and take the indicated action - works fine by the way. Then the cursor should return to the "rms" location and delete that range name.

    The "rms" range name is always attached to the cell that is double-clicked. I was under the impression that this type of code would fire prior to any double-click action.

    Can any offer any suggestions as to where I went wrong?

    TIA.

    Bob
    Last edited by bstubbs; 03-19-2009 at 07:22 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1