Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
When you change cells is there a way to tell which was the last active cell.
Thank you, Steven |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ctrl-Z will take you back there.
-- __________________________________ HTH Bob "Steven" wrote in message ... When you change cells is there a way to tell which was the last active cell. Thank you, Steven |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi
excel doesn't remember last cells but you can do it with variables. dim r as range range("A1").select set r = activecell range("B9").select 'A1 was last activecell set r = activecell 'now B9 is last activecell. you can set varaibles for last sheet also so as to return to a point(sheet and cell) after going off to do other stuff. regards FSt1 regards FSt1 "Steven" wrote: When you change cells is there a way to tell which was the last active cell. Thank you, Steven |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Put this in the ThisWorkBook module:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) Dim LastCell As String LastCell = Cells(Target.Row, Target.Column).Address End Sub "Steven" wrote: When you change cells is there a way to tell which was the last active cell. Thank you, Steven |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob
Is there some reference that has to be active for this Ctrl-Z to work? I have 2002 and Ctrl-Z doesn't do anything for me. Thanks for your time. Otto "Bob Phillips" wrote in message ... Ctrl-Z will take you back there. -- __________________________________ HTH Bob "Steven" wrote in message ... When you change cells is there a way to tell which was the last active cell. Thank you, Steven |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Kent
What does do this do toward finding the previous cell? Otto "Kent Prokopy" wrote in message ... Put this in the ThisWorkBook module: Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) Dim LastCell As String LastCell = Cells(Target.Row, Target.Column).Address End Sub "Steven" wrote: When you change cells is there a way to tell which was the last active cell. Thank you, Steven |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ctrl-z is Undo.
-- Jim "Otto Moehrbach" wrote in message ... | Bob | Is there some reference that has to be active for this Ctrl-Z to work? | I have 2002 and Ctrl-Z doesn't do anything for me. Thanks for your time. | Otto | "Bob Phillips" wrote in message | ... | Ctrl-Z will take you back there. | | -- | __________________________________ | HTH | | Bob | | "Steven" wrote in message | ... | When you change cells is there a way to tell which was the last active | cell. | | Thank you, | | Steven | | | |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim
Maybe I just missed something, but the OP was asking how to find the previously selected cell, and a selection change does not get into the Undo buffer. Hitting Undo will take him back to the previous cell only if he changed the contents of that cell. What did I miss? Otto "Jim Rech" wrote in message ... Ctrl-z is Undo. -- Jim "Otto Moehrbach" wrote in message ... | Bob | Is there some reference that has to be active for this Ctrl-Z to work? | I have 2002 and Ctrl-Z doesn't do anything for me. Thanks for your time. | Otto | "Bob Phillips" wrote in message | ... | Ctrl-Z will take you back there. | | -- | __________________________________ | HTH | | Bob | | "Steven" wrote in message | ... | When you change cells is there a way to tell which was the last active | cell. | | Thank you, | | Steven | | | |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You interpreted his "last activecell" as "previously selected cell". Just
as valid is the last active cell in the sheet (gotten to via {End}{Home}). However I was just saying what Ctrl-z was since I thought you were asking. I have no opinion on the efficacy of Bob's suggestion<g. -- Jim "Otto Moehrbach" wrote in message ... | Jim | Maybe I just missed something, but the OP was asking how to find the | previously selected cell, and a selection change does not get into the Undo | buffer. Hitting Undo will take him back to the previous cell only if he | changed the contents of that cell. What did I miss? Otto | "Jim Rech" wrote in message | ... | Ctrl-z is Undo. | | -- | Jim | "Otto Moehrbach" wrote in message | ... | | Bob | | Is there some reference that has to be active for this Ctrl-Z to | work? | | I have 2002 and Ctrl-Z doesn't do anything for me. Thanks for your | time. | | Otto | | "Bob Phillips" wrote in message | | ... | | Ctrl-Z will take you back there. | | | | -- | | __________________________________ | | HTH | | | | Bob | | | | "Steven" wrote in message | | ... | | When you change cells is there a way to tell which was the last | active | | cell. | | | | Thank you, | | | | Steven | | | | | | | | |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Not sure who Otto and Jim are or why they are so combative.
I was looking for the same thing today and came across your question. Kent's idea is pretty close, and I worked from that. Here is what I ended up with. Define a couple of Public strings: ThisCell and LastCell. Then in your Sheet Module, put this: Private Sub Worksheet_SelectionChange(ByVal Target As Range) LastCell = ThisCell ThisCell = ActiveCell.Address End Sub You may also want to initialize ThisCell in the Workbook_Open module. Then each time you move to a different cell, LastCell will give you the cell address of the previous cell. -- Bill @ UAMS "Steven" wrote: When you change cells is there a way to tell which was the last active cell. Thank you, Steven |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
If activecell.column = variable then activecell,offset (0,1) | Excel Discussion (Misc queries) | |||
How to Revert to ActiveCell.Formula = format from ActiveCell.FormulaR1C1 = format | Excel Programming | |||
ActiveCell | Excel Programming | |||
IF Activecell | Excel Programming | |||
if activecell is value | Excel Programming |