View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default automatically go to a cell (excel)

You mean if the value of A1 is same as value of B100 or if A1 contains the
formula =B100 ?

If the latter, go to ToolsOptionsEdit and uncheck "edit directly in cell"

If the former you would need doubleclick event code.

Private Sub Worksheet_BeforeDoubleClick _
(ByVal Target As Range, Cancel As Boolean)
On Error GoTo enditall
Application.EnableEvents = False
If Not Intersect(Target, Range("A1")) Is Nothing Then
If Target.Value = Range("B100").Value Then
Range("B100").Select
End If
End If
enditall:
Application.EnableEvents = True
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code"

Copy/paste the above into that sheet module.


Gord Dibben MS Excel MVP

On Tue, 27 Feb 2007 13:58:45 -0800, chbelair
wrote:

For example, if cell a1 = b100, I would like to be able to double click on A1
and automatically go to cell b100.