Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Worksheet_Change on Excel 97

Hi,
I'm running on Excel 97 and use this event macro to keep history of
modifications :

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column = 1 Then
Cells(Target.Row, Target.Column + 1) = Now
Cells(Target.Row, Target.Column + 2) =
CreateObject("Wscript.Network").UserName
End If
Application.EnableEvents = True
End Sub

I also use, for the first column cells, the "Validation" tool allowing only
three param values in the cell.

Problem : the event macro works by typing the param value and pressing
"enter" key but NO by selecting a direct value within the combo list.

Any idea to make it work ?! Thanks in advance...

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Worksheet_Change on Excel 97

In xl97, the change event does not fire in this situation if you populate
the validation from cells on the worksheet. I understand that if you hard
code the values in the textbox for the list in the data validation dialog
(Data=Validation, list option), then it will fire. So that would be a work
around if you only allow 3 values.

--
Regards,
Tom Ogilvy

"Willow" wrote in message
...
Hi,
I'm running on Excel 97 and use this event macro to keep history of
modifications :

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column = 1 Then
Cells(Target.Row, Target.Column + 1) = Now
Cells(Target.Row, Target.Column + 2) =
CreateObject("Wscript.Network").UserName
End If
Application.EnableEvents = True
End Sub

I also use, for the first column cells, the "Validation" tool allowing

only
three param values in the cell.

Problem : the event macro works by typing the param value and pressing
"enter" key but NO by selecting a direct value within the combo list.

Any idea to make it work ?! Thanks in advance...



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Worksheet_Change on Excel 97

Many thanks Tom...

"Tom Ogilvy" wrote:

In xl97, the change event does not fire in this situation if you populate
the validation from cells on the worksheet. I understand that if you hard
code the values in the textbox for the list in the data validation dialog
(Data=Validation, list option), then it will fire. So that would be a work
around if you only allow 3 values.

--
Regards,
Tom Ogilvy

"Willow" wrote in message
...
Hi,
I'm running on Excel 97 and use this event macro to keep history of
modifications :

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column = 1 Then
Cells(Target.Row, Target.Column + 1) = Now
Cells(Target.Row, Target.Column + 2) =
CreateObject("Wscript.Network").UserName
End If
Application.EnableEvents = True
End Sub

I also use, for the first column cells, the "Validation" tool allowing

only
three param values in the cell.

Problem : the event macro works by typing the param value and pressing
"enter" key but NO by selecting a direct value within the combo list.

Any idea to make it work ?! Thanks in advance...




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Worksheet_Change on Excel 97

You could also add a reference to that DV cell (=H10 say), and then use the
Worksheet_Calculate event to do your stuff, as this does then get triggered.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Willow" wrote in message
...
Hi,
I'm running on Excel 97 and use this event macro to keep history of
modifications :

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column = 1 Then
Cells(Target.Row, Target.Column + 1) = Now
Cells(Target.Row, Target.Column + 2) =
CreateObject("Wscript.Network").UserName
End If
Application.EnableEvents = True
End Sub

I also use, for the first column cells, the "Validation" tool allowing

only
three param values in the cell.

Problem : the event macro works by typing the param value and pressing
"enter" key but NO by selecting a direct value within the combo list.

Any idea to make it work ?! Thanks in advance...



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
Worksheet_Change method not working in Excel 97 Manoj Kumar Sharma Excel Programming 4 October 6th 04 10:38 AM
Worksheet_Change event doesn't work in Excel 97 kysiow Excel Programming 1 June 10th 04 11:32 AM
Worksheet_Change event doesn't work in Excel 97 kysiow Excel Programming 0 June 10th 04 09:41 AM
worksheet_change vs. calculate, and worksheet_change not running Tom Ogilvy Excel Programming 1 July 14th 03 02:51 AM
worksheet_change vs. calculate, and worksheet_change not running Ross[_5_] Excel Programming 0 July 13th 03 04:27 PM


All times are GMT +1. The time now is 05:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"