ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Previous active cell (https://www.excelbanter.com/excel-programming/319847-previous-active-cell.html)

MVM

Previous active cell
 
How to find the location of the previous activecell?
Appreciate the help.
MVM

Frank Kabel

Previous active cell
 
Hi
one brute-force way would be to use the SelectionChange event to store the
old active cell in a static variable. what are you trying to do with this
information

--
Regards
Frank Kabel
Frankfurt, Germany
"MVM" schrieb im Newsbeitrag
...
How to find the location of the previous activecell?
Appreciate the help.
MVM




Ray Costanzo [MVP]

Previous active cell
 
Like, if user moves from G6 to L8, you want to return a reference to
G6? You'll have to carry the reference along either in a hidden
sheet or in a variable with scope outside of a subroutine. Example:

Option Explicit

Dim sCurrentAddress As String
Dim sOldAddress As String

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
sOldAddress = sCurrentAddress
sCurrentAddress = Target.Address
MsgBox "From " & sOldAddress
End Sub

Ray at work


"MVM" wrote in message
...
How to find the location of the previous activecell?
Appreciate the help.
MVM




MVM

Previous active cell
 

Thank you.
I have two columns, say C & D.
if user enters in D and C is empty, I display a message and move the active
cell in C (same row). when user enters a value in C and then enters in D and
hit RETURN key, I don't want to display the message, simply move to next row
C.

how to find I hit RETURN?
or the previous cell is in D?

is there any way to display a tool tip when user moves to column D with
empty C?

Thanks
MVM

"Frank Kabel" wrote:

Hi
one brute-force way would be to use the SelectionChange event to store the
old active cell in a static variable. what are you trying to do with this
information

--
Regards
Frank Kabel
Frankfurt, Germany
"MVM" schrieb im Newsbeitrag
...
How to find the location of the previous activecell?
Appreciate the help.
MVM






All times are GMT +1. The time now is 01:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com