Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default SelectionChange Event question

I want a simple message box that displays whenever I create a new selection
in a worksheet. The message box needs to display both the address of the
last selection and the address of the new selection. I have the following
solution:

Dim LastSelected As String
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
MsgBox LastSelected & Target.Address
LastSelected = Target.Address
End Sub

This works fine except for the first time through, when LastSelected is
empty. How can I get the initial selection to display in the message box?

Many thanks.

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
SelectionChange Event James Excel Programming 5 September 16th 09 11:36 PM
SelectionChange event Kate Excel Programming 2 December 22nd 05 06:03 PM
SelectionChange event Hayeso Excel Programming 2 July 1st 05 03:07 PM
SelectionChange event Stefi Excel Programming 2 October 28th 04 01:26 PM
SelectionChange Event Squid[_3_] Excel Programming 5 February 11th 04 01:57 PM


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

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

About Us

"It's about Microsoft Excel"