Go_to cell funtion

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
 
S

Steve Garman

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
 
J

JE McGimpsey

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top