Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Command button macro query

Thanks guys - I tried Ander S's solution and it works brilliantly
Muchly appreciation


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use Macro To Change Which Macro Assigned To Command Button CVinje Excel Discussion (Misc queries) 0 May 25th 10 09:55 PM
Command button macro Mark N Excel Discussion (Misc queries) 6 August 28th 09 10:31 PM
Run a macro using a command button Tdahlman Excel Discussion (Misc queries) 9 March 5th 08 07:59 PM
Run Macro from Command Button [email protected] Excel Discussion (Misc queries) 1 April 23rd 07 04:36 PM
Command Button & Macro alexm999[_10_] Excel Programming 2 January 28th 04 09:12 PM


All times are GMT +1. The time now is 11:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"