Go_to cell funtion

  • Thread starter Thread starter David Lariscy
  • Start date Start date
D

David Lariscy

Hi,
How can I make a cell serve a go_to function within a worksheet. e.g.
if one clicks on "A1" then the active cell becomes "A8" and the cursor
moves there. If this is a really dumb question then I fortunately (for now)
can blame it on the massive antihistamine regimen; thanks in advance.

D
 
It can be done using an event macro but I'm not aware of any way of
doing it with worksheet functions.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Range("a1"), Target) Is Nothing Then
Range("a8").Activate
End If
End Sub
 
Can't do it with a worksheet function. One nifty way:

Create a textbox from the drawing toolbar exactly the size of the cell,
and make it transparent without a border (position it first unless you
like moving invisible objects). Format it to move and size with cells.
Attach a macro:


Public Sub TextBox1_Click()
Range("A8").Select
End Sub

This avoids one problem of using the Worksheet_SelectionChange - that
using the arrow keys, tab, enter, etc, also selects the cell and
triggers the event.
 
Back
Top