Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Last Selected Cell

Hi, I'm writing a macro which needs to run whenever a cell changes. To
do this I've set the macro to run on the Worksheet_Change function
which works perfectly. The problem I'm having is how to establish the
cell which was previously selected by the user before they either tab
or carriage return. ie. If the user is on cells A3 and enters "here",
I need to macro to tell me that the user changed row 3, column 1.

Any ideas?

Many Thanks!!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Last Selected Cell

Target holds a reference to the cell that was changed.

Private Sub Worksheet_Change(ByVal Target As Range)
msgbox Target.Address & " was changed and triggered this macro"
End Sub

--
Regards,
Tom Ogilvy


"DAV135" wrote:

Hi, I'm writing a macro which needs to run whenever a cell changes. To
do this I've set the macro to run on the Worksheet_Change function
which works perfectly. The problem I'm having is how to establish the
cell which was previously selected by the user before they either tab
or carriage return. ie. If the user is on cells A3 and enters "here",
I need to macro to tell me that the user changed row 3, column 1.

Any ideas?

Many Thanks!!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Last Selected Cell

Fantastic! Thanks for your help!

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
Multiple cells or columns are selected instead of selected cell or Mikey Excel Discussion (Misc queries) 1 April 29th 09 09:48 PM
Macro to transfer contents of 'Selected' cell to alternate cell. Gryndar Excel Worksheet Functions 7 December 20th 08 09:58 PM
Macro to take selected cells times a selected cell Craig Excel Programming 4 October 24th 05 12:54 AM
how read value from last selected cell? It is possible? how get adress last selected cell? Andrzej New Users to Excel 4 May 30th 05 07:28 PM
how read value from last selected cell? It is possible? how get adress last selected cell? Andrzej Excel Programming 1 May 30th 05 06:18 PM


All times are GMT +1. The time now is 08:27 PM.

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

About Us

"It's about Microsoft Excel"