Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What Cell Did I Come From? 1

Status
Not open for further replies.

Elysium

Programmer
Aug 7, 2002
212
US
Has anyone seen how to capture which cell you are coming from in Excel? My example is such:

If I am in cell A1 and I click on cell D4, I want to be able to know that I was previously in cell A1. Anyone?

RS
 
Use the selectionchange event:

rivate Sub Worksheet_SelectionChange(ByVal Target As Range)
Static Kilroy As String
MsgBox ("I was here: " & Kilroy)
Kilroy = Target.Address
End Sub
Rob
[flowerface]
 
Thank you, thank you!! Works like a charm.

RS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top