Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Private Sub Worksheet_Change(ByVal Target As Range)
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Private Sub Worksheet_Change(ByVal Target As Range)
Check VB help for the onkey method, then you can stop the date from printing
if ctl and - are pressed. -John "pd1234321" wrote: 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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Private Sub Worksheet_Change(ByVal Target As Range)
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. "John Bundy" wrote: Check VB help for the onkey method, then you can stop the date from printing if ctl and - are pressed. -John "pd1234321" wrote: 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. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Private Sub Worksheet_Change(ByVal Target As Range)
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 pd1234321 wrote: 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. -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Private Sub Worksheet_Change(ByVal Target As Range)
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. "Dave Peterson" wrote: 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 pd1234321 wrote: 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. -- Dave Peterson |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Private Sub Worksheet_Change(ByVal Target As Range)
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 "pd1234321" wrote in message ... 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Control Toolbox and Private Sub Worksheet_Change(ByVal Target As R | Excel Discussion (Misc queries) | |||
Control Toolbox and Private Sub Worksheet_Change(ByVal Target | Excel Discussion (Misc queries) | |||
Private Sub Worksheet_Change(ByVal Target As Excel.Range) | Excel Programming | |||
Private Sub Worksheet_Change(ByVal Target As Excel.Range) | Excel Worksheet Functions | |||
Private Sub Worksheet_Change(ByVal Target As Range) | Excel Programming |