Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Return cursor to previous position
I'm using Excel 2000. I'm sure that in earlier versions there was a function
key that returned the cursor to the previous position. I have always remembered it being or involving the F5 key, but the nearest I can get is a selection box. The "Help" file offers nothing. Its such a simple function it has to exist! Can someone help? I'm looking for this as an alternative because Excel is incapable of creating a relative range name during a macro. Even clicking the "relative" option still results in recording an absolute reference to the cell referenced during macro creation, rather than the keystrokes used to produce it. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Return cursor to previous position
Hi Kevryl:
You can create this feature within a single sheet: In worksheet code enter: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Set oldr = r Set r = Target End Sub In a standard module enter: Public r As Range Public oldr As Range Sub goback() If oldr Is Nothing Then Else oldr.Select End If End Sub and assign a shortcut like CNTRL+e to goback. As you either click or arrow around the sheet, CNTRL+e will return you to the previous selection. REMEMBER: this will work only within a single sheet. -- Gary''s Student - gsnu200715 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Return cursor to previous position
Thanks Gary's Student.
You're speaking a bit above my level. Is this 2 ways of doing the same thing or do both the worksheet code bit and the standard module bit have to be done? Where do I go to enter worksheet code? Is that the X symbol to the left of "File" right click/View code routine? Standard module: Is that the modules where macros are recorded into? I've done quite a bit of manipulation in there with amending copied macros. "Gary''s Student" wrote: Hi Kevryl: You can create this feature within a single sheet: In worksheet code enter: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Set oldr = r Set r = Target End Sub In a standard module enter: Public r As Range Public oldr As Range Sub goback() If oldr Is Nothing Then Else oldr.Select End If End Sub and assign a shortcut like CNTRL+e to goback. As you either click or arrow around the sheet, CNTRL+e will return you to the previous selection. REMEMBER: this will work only within a single sheet. -- Gary''s Student - gsnu200715 |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Return cursor to previous position
We need to do both:
First insert the module code: 1. ALT-F11 brings up the VBE window 2. ALT-I ALT-M opens a fresh module 3. paste this stuff in and close the VBE window: Public r As Range Public oldr As Range Sub goback() If oldr Is Nothing Then Else oldr.Select End If End Sub Next insert the worksheet code: 1. right-click the tab name near the bottom of the window 2. select View Code - this brings up a VBE window 3. paste this stuff in and close the VBE window: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Set oldr = r Set r = Target End Sub You can then assign the shortcut to goback. Note that none of this is necesary if you are navagating a single worksheet using hyperlinks. You can always return from a hyperlink with the Back button. -- Gary''s Student - gsnu200715 |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Return cursor to previous position
Thanks Garys Student. Looks easy enough now!
REgards, Kevryl "Gary''s Student" wrote: We need to do both: First insert the module code: 1. ALT-F11 brings up the VBE window 2. ALT-I ALT-M opens a fresh module 3. paste this stuff in and close the VBE window: Public r As Range Public oldr As Range Sub goback() If oldr Is Nothing Then Else oldr.Select End If End Sub Next insert the worksheet code: 1. right-click the tab name near the bottom of the window 2. select View Code - this brings up a VBE window 3. paste this stuff in and close the VBE window: Private Sub Worksheet_SelectionChange(ByVal Target As Range) Set oldr = r Set r = Target End Sub You can then assign the shortcut to goback. Note that none of this is necesary if you are navagating a single worksheet using hyperlinks. You can always return from a hyperlink with the Back button. -- Gary''s Student - gsnu200715 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
cursor position | Excel Discussion (Misc queries) | |||
how do you make the cursor position have a color ? | New Users to Excel | |||
Position Cursor to same address on another tab | Excel Worksheet Functions | |||
Cursor position | Excel Discussion (Misc queries) | |||
Cursor position? | Excel Discussion (Misc queries) |