LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Code to run on worksheet selection change

I am programming code to run whenever the user changes
cells within an excel spreadsheet. How can I have the
code check to see what cell the user just selected, assign
this to a variable, then run a select case statement on
that variable?

Here's where I am so far:

Private Sub Worksheet_SelectionChange(ByVal Target As
Excel.Range)
Dim CurrentRange As Range

'CurrentRange = ********This is where I need help,
assigning the variable**********

Select Case CurrentRange
Case... 'do stuff depending on which cell is selected
Case... '
End Select
End Sub

Any help is much appreciated.
Dan Winterton
 
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
Quick VBA Worksheet Change Event or Selection Question: Damil4real Excel Worksheet Functions 6 November 17th 09 10:28 PM
CHANGE DEFAULT PRINT TO SELECTION INSTEAD OF ACTIVE WORKSHEET FRED SMITH New Users to Excel 2 June 27th 06 07:43 PM
Running code on a drop down selection change Steve Haack Excel Worksheet Functions 1 April 26th 05 05:03 AM
Worksheet change code Frank Kabel Excel Programming 1 July 27th 04 04:58 PM
Worksheet Selection Change DEFJ Excel Programming 4 November 15th 03 11:45 PM


All times are GMT +1. The time now is 07:51 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"