MrExcel Publishing
Your One Stop for Excel Tips & Solutions

How do I move to a range with a button


Posted by Stephen on April 30, 2001 2:58 PM

Here's what I'm trying to do. I want to press a button and have it select a new range on another sheet. Lets say I want B100 to be in the upper left corner and I dont want to select a whole range and have it highlighted.
Thanks for any assistance you can provide.

Stephen


Posted by mark on April 30, 2001 3:10 PM

Have you tried recording your actions (tools / macro / record new macro?)

Then you can draw a shape with autoshapes, right click the object and "assign a macro."

good luck,
mb

Posted by Dave Hawley on April 30, 2001 3:13 PM

Hi stephen

Sounds like a job for GoTo. Run this code:


Sub TryThis()
Application.Goto _
Reference:=Sheets("Sheet2").Range("B100"), Scroll:=True
End Sub


Dave
OzGrid Business Applications

Posted by stephen on April 30, 2001 3:20 PM

Hi dave thanks for the responce. I'm now getting a subsript out of range error)
stephen

Posted by Dave Hawley on April 30, 2001 3:28 PM


Steve, you will need to change "Sheet2" to a Worksheet name within the Workbook.

Dave

OzGrid Business Applications

Posted by STEPHEN on April 30, 2001 3:36 PM

THANKS DAVE IT WORKS