View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Anders S[_2_] Anders S[_2_] is offline
external usenet poster
 
Posts: 57
Default 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.