View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default BeforeSelectionChange

Asif,

In a regular codemodule (change the 10 to the number of steps you want to track):

Public mySel(1 To 10) As String

Sub ShowPastSelections()
Dim myPast As String
Dim i As Integer

myPast = ""
For i = LBound(mySel) To UBound(mySel)
myPast = myPast & Chr(10) & mySel(i)
Next i
MsgBox myPast
End Sub

Put this in the ThisWorkbook's Codemodule:

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Dim i As Integer
For i = UBound(mySel) To LBound(mySel) + 1 Step -1
mySel(i) = mySel(i - 1)
Next i
mySel(LBound(mySel)) = Target.Address(, , , True)
End Sub

--
HTH,
Bernie
MS Excel MVP


"Asif" wrote in message
...
I want to track prior cell address before "selectionchange" event.

I'd much appreciate any help in this respect.
--
Thanx & regards,
Asif