Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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
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
Control Toolbox and Private Sub Worksheet_Change(ByVal Target As R [email protected] Excel Discussion (Misc queries) 1 August 17th 07 09:38 AM
Control Toolbox and Private Sub Worksheet_Change(ByVal Target Toppers Excel Discussion (Misc queries) 0 August 17th 07 01:52 AM
Private Sub Worksheet_Change(ByVal Target As Excel.Range) Arturo Excel Programming 5 March 9th 07 04:30 PM
Private Sub Worksheet_Change(ByVal Target As Excel.Range) [email protected] Excel Worksheet Functions 0 December 21st 06 02:13 AM
Private Sub Worksheet_Change(ByVal Target As Range) Arturo Excel Programming 1 May 25th 05 03:32 PM


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