Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command button macro query
Hi al
Is there a function (eg Shift Cntrl R) or maybe I need to create a command button that when clicked, will return the user to the last cell they entered Currently the user enters data on a row, then scrolls down heaps of rows (in which other data is entered) to the totals row (or they use the name box to select a defined cell that refers to the totals they want) and they check the results. They then want to return to the cell they just entered but are finding it cumbersome to find it Any help would be greatly appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command button macro query
It is not elegant, but the user can click on Edit, Undo, and then Edit, Redo
and that will put them back to the last modified cell and the cell will be as modified. Bob Flanagan Macro Systems http://www.add-ins.com Productivity add-ins and downloadable books on VB macros for Excel "BeSmart" wrote in message ... Hi all Is there a function (eg Shift Cntrl R) or maybe I need to create a command button that when clicked, will return the user to the last cell they entered? Currently the user enters data on a row, then scrolls down heaps of rows (in which other data is entered) to the totals row (or they use the name box to select a defined cell that refers to the totals they want) and they check the results. They then want to return to the cell they just entered but are finding it cumbersome to find it. Any help would be greatly appreciated. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command button macro query
BeSmart,
Here's one possible way to get started. *** Enter the following code in the worksheet code window (right-click the worksheet tab and choose View Code) '----- Option Explicit Public LastEnteredCell As Range Private Sub Worksheet_Change(ByVal Target As Range) Set LastEnteredCell = Target End Sub Sub goBack() LastEnteredCell.Select End Sub '----- *** To assign the shortcut - Ctrl+Shift+R - do ToolsMacroMacros, select goBack, click Options and enter R in the shortcut box. HTH Anders Silven "BeSmart" skrev i meddelandet ... Hi all Is there a function (eg Shift Cntrl R) or maybe I need to create a command button that when clicked, will return the user to the last cell they entered? Currently the user enters data on a row, then scrolls down heaps of rows (in which other data is entered) to the totals row (or they use the name box to select a defined cell that refers to the totals they want) and they check the results. They then want to return to the cell they just entered but are finding it cumbersome to find it. Any help would be greatly appreciated. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command button macro query
If I read the original post correctly, the user will be entering mor
than one piece of data in the lower rows. Therefore the simpl worksheet_change suggestion probably won't do the trick. (You did sa it was only to get them started...) But, building on it a bit, you could use an array and save the last 1 positions (or more if you wanted). My solution doesn't have a "g forward" option, but it could be implemented using an array inde pointer. Give this a shot: Code ------------------- Dim adrLast(10) As String Private Sub Worksheet_Change(ByVal Target As Range) Dim i As Integer For i = 1 To 10 adrLast(i) = adrLast(i - 1) Next adrLast(0) = Target.Address End Sub Sub GoBack() Dim i As Integer Range(adrLast(0)).Select For i = 1 To 10 adrLast(i - 1) = adrLast(i) Next End Su ------------------- Also in the worksheet module of the worksheet in question just lik Anders suggested -- Message posted from http://www.ExcelForum.com |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command button macro query
Thanks guys - I tried Ander S's solution and it works brilliantly
Muchly appreciation |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command button macro query
Glad to hear that :)
Anders "BeSmart" skrev i meddelandet ... Thanks guys - I tried Ander S's solution and it works brilliantly. Muchly appreciation |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Use Macro To Change Which Macro Assigned To Command Button | Excel Discussion (Misc queries) | |||
Command button macro | Excel Discussion (Misc queries) | |||
Run a macro using a command button | Excel Discussion (Misc queries) | |||
Run Macro from Command Button | Excel Discussion (Misc queries) | |||
Command Button & Macro | Excel Programming |