Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Identifying the Selected Cell
I am needing a set of code to run when a range of cells have one of them changed, and I am not sure how to event this. I had thought to use a Selection_Change event but I am still not sure how to tell what cell is/was selected. Is there a standard command to retrieve the address of either the newly selected cell or the one being moved away from? -- Warderbrad ------------------------------------------------------------------------ Warderbrad's Profile: http://www.excelforum.com/member.php...o&userid=28169 View this thread: http://www.excelforum.com/showthread...hreadid=487652 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Identifying the Selected Cell
in selection change you can use this code: for i=0 to target.count - 1 selectedRow=target(i).row +1 selectedColumn=target(i).column next I didn't try it but i think it's correct -- antoka05 ------------------------------------------------------------------------ antoka05's Profile: http://www.excelforum.com/member.php...o&userid=29024 View this thread: http://www.excelforum.com/showthread...hreadid=487652 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Identifying the Selected Cell
If you use the Worksheet_Change event the changed cell is passed toi the
event procedure as a parameter. Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo ws_exit: Application.EnableEvents = False With Target 'do your stuff End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. In this example, Target refers to the cell changed. -- HTH RP (remove nothere from the email address if mailing direct) "Warderbrad" wrote in message ... I am needing a set of code to run when a range of cells have one of them changed, and I am not sure how to event this. I had thought to use a Selection_Change event but I am still not sure how to tell what cell is/was selected. Is there a standard command to retrieve the address of either the newly selected cell or the one being moved away from? -- Warderbrad ------------------------------------------------------------------------ Warderbrad's Profile: http://www.excelforum.com/member.php...o&userid=28169 View this thread: http://www.excelforum.com/showthread...hreadid=487652 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Trouble identifying selected records | Excel Discussion (Misc queries) | |||
Identifying a Selected Range in a Macro | Excel Discussion (Misc queries) | |||
Macro to take selected cells times a selected cell | Excel Programming | |||
Identifying the selected Shape | Excel Programming | |||
Identifying Multiple Selected Worksheets | Excel Programming |