#1   Report Post  
Posted to microsoft.public.excel.misc
DCSwearingen
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
mrice
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
DCSwearingen
 
Posts: n/a
Default 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
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
Inserting Filtered RC cell information into other worksheets Dennis Excel Discussion (Misc queries) 10 July 30th 05 01:54 AM
Search/Match between 2 x separate Worksheets and populate result in third worksheet Alan Bartley Excel Discussion (Misc queries) 1 April 11th 05 05:21 AM
Copy from worksheet to another x times Union70 Excel Discussion (Misc queries) 0 March 7th 05 09:03 PM
Weekly Transaction Processing Ralph Howarth Excel Worksheet Functions 4 January 19th 05 05:37 AM
copyright and worksheet protection dow Excel Discussion (Misc queries) 2 January 3rd 05 03:07 PM


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