Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Worksheet Events
I would like to capture the cell address a user enters data. I have tried the following: Private Sub Worksheet_Change(ByVal Target As Range) Dim myRow As Long, myColumn As Long myRow = Selection.Row myColumn = Selection.Column End Sub This works perfectly if the user enters the value and then presses the <Enter key. However if the user enters data and then clicks into a different cell without hitting the <Enter key, it captures the address of the new cell. The same issue is present whether I use the Worksheet_Calculate and Worksheet_SelectionChange events. What I am trying to do is automatically insert a new row immediately below the row the data was entered into (a specific column's data entry). I need to do this because we want to maintain a specific format (also identify the new data range) and users will utilize many different methods of doing this manually. They invariably cause issues with identifying a specific data range or they mess up the format. I have my routine for inserting a new row, setting the format, and identifying the new data range. I just need to know how to make sure I have the cell the data was actually entered into rather than the new cell if they enter by moving to a new cell. -- DCSwearingen ------------------------------------------------------------------------ DCSwearingen's Profile: http://www.excelforum.com/member.php...o&userid=21506 View this thread: http://www.excelforum.com/showthread...hreadid=545102 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Worksheet Events
If you change 'Selection' to 'Target' you will get what you need. -- mrice Research Scientist with many years of spreadsheet development experience ------------------------------------------------------------------------ mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931 View this thread: http://www.excelforum.com/showthread...hreadid=545102 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Worksheet Events
Works perfectly now!! Thanks again to all who answer our questions!!! -- DCSwearingen Getting old, but love computers. ------------------------------------------------------------------------ DCSwearingen's Profile: http://www.excelforum.com/member.php...o&userid=21506 View this thread: http://www.excelforum.com/showthread...hreadid=545102 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Inserting Filtered RC cell information into other worksheets | Excel Discussion (Misc queries) | |||
Search/Match between 2 x separate Worksheets and populate result in third worksheet | Excel Discussion (Misc queries) | |||
Copy from worksheet to another x times | Excel Discussion (Misc queries) | |||
Weekly Transaction Processing | Excel Worksheet Functions | |||
copyright and worksheet protection | Excel Discussion (Misc queries) |