Private Sub Worksheet_Change(ByVal Target As Range)

G

Guest

Hello,

I am using the Worksheet_Change function above to record the time a user
makes a change to the worksheet. It is working great, except that I don't
want to record the change if the user deletes the entire row (selects the
entire row and hits CTRL-). The reason I don't want to record this change is
that it actually records the date of the change on the next row, which
actually didn't change.

I am using a little If Then statement in the beginning of the routine to
skip past the change code when I use another module to load information into
the worksheet. That works fine, but I don't know how to handle the issue
above.

First time poster. I would really appreciate any help.

Thank you.
 
G

Guest

Check VB help for the onkey method, then you can stop the date from printing
if ctl and - are pressed.

-John
 
G

Guest

I am looking at the onkey help, but I cannot get it to work. Do you call the
onkey function within the sub itself? I really appreciate your help.
 
D

Dave Peterson

I'm not sure how you can find out if the row was deleted, but you could do this
if you want to ignore any changes that are done to complete rows.

If Target.Address = Target.EntireRow.Address Then
Exit Sub
End If
 
G

Guest

Thank you Dave. I think this is going to do it for me. I think there is
something strange about using onkey on the CONTROL+PLUSSIGN in the following:
the Application.OnKey "^{+}", "CalledRoutine". I can make a letter work in
place of the control+, but not the code the way it is. As I say, I think for
my purposes just knowing that the whole row was selected will work fine. You
guys are great. Thank you very much.
 
N

NickHK

See the recent thread "Row menu Insert control ID changes" (and the link
provided) in this NG for one way to detect a row deletion.

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top