Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() So, whenever a user exits a cell in column D, the macro runs. I' currently using Worksheet.SelectionChange, but this runs whenever AN cell is exited. Any ideas -- madblok ----------------------------------------------------------------------- madbloke's Profile: http://www.excelforum.com/member.php...fo&userid=1442 View this thread: http://www.excelforum.com/showthread.php?threadid=46814 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi MadBloke,
Try replacing your existing Worksheet_SelectionChange procedure with: '=================== Option Explicit Private col As Long <<=== At top of worksheet module '--------------------------------- Private Sub Worksheet_Activate() Set rngOld = ActiveCell.Column End Sub '--------------------------------- Private Sub Worksheet_SelectionChange(ByVal Target As Range) Const MyCol As Long = 4 'Column "D" If Target.Column = MyCol Then col = 4 Exit Sub End If If col = MyCol Then 'User has exited column "D" 'Do something, e.g.: MsgBox "You have exited column D" End If col = Target.Column End Sub '<<=================== --- Regards, Norman "madbloke" wrote in message ... So, whenever a user exits a cell in column D, the macro runs. I'm currently using Worksheet.SelectionChange, but this runs whenever ANY cell is exited. Any ideas? -- madbloke ------------------------------------------------------------------------ madbloke's Profile: http://www.excelforum.com/member.php...o&userid=14422 View this thread: http://www.excelforum.com/showthread...hreadid=468148 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() That kind of worked. Basically, what I'm trying to do is when someone types their name into a cell in Column D, to search through a list on another sheet, and auto-fill in other details for them (staff number etc). Currently, it works, but only if the user types their name and then presses Return (I'm using Offset (-1, 0) to get the user input). What I need is to capture the user's input into Column D regardless of whether they press Return, Tab, or click out of the column. Any ideas? -- madbloke ------------------------------------------------------------------------ madbloke's Profile: http://www.excelforum.com/member.php...o&userid=14422 View this thread: http://www.excelforum.com/showthread...hreadid=468148 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro from cell specific to whole column | Excel Discussion (Misc queries) | |||
Macro running when a cell is exited | Excel Discussion (Misc queries) | |||
Excel Macro Query - Search for specific text in cells of a column | Excel Programming | |||
Apply Macro to Specific Column | Excel Programming | |||
Apply Macro to Specific Column | Excel Programming |