![]() |
Code Works on Windows 2000 but not on XP
HI,
Does anyone have an idea why this code works on Windows 2000 SP4 but not on XP??? Private Sub Worksheet_Change(ByVal Target As Range) Application.EnableEvents = False If Target.Address = "$G$10" Then _ Target.Offset(, 2) = Target.Offset(, -2) * Target * (-1) If Target.Address = "$I$2" Then _ Target.Offset(, -2) = Target / Target.Offset(, -4) * (-1) Application.EnableEvents = True If Target.Row < 10 Then Exit Sub Application.EnableEvents = False If Target.Column = 7 Then _ Target.Offset(, 2) = Target.Offset(, -2) * Target * (-1) If Target.Column = 9 Then _ Target.Offset(, -2) = Target / Target.Offset(, -4) * (-1) Application.EnableEvents = True End Sub Thanks, Amir |
Code Works on Windows 2000 but not on XP
I'm on 2003 (XP?) and it seems to work here. What's the problem?
"amirstal" wrote: HI, Does anyone have an idea why this code works on Windows 2000 SP4 but not on XP??? Private Sub Worksheet_Change(ByVal Target As Range) Application.EnableEvents = False If Target.Address = "$G$10" Then _ Target.Offset(, 2) = Target.Offset(, -2) * Target * (-1) If Target.Address = "$I$2" Then _ Target.Offset(, -2) = Target / Target.Offset(, -4) * (-1) Application.EnableEvents = True If Target.Row < 10 Then Exit Sub Application.EnableEvents = False If Target.Column = 7 Then _ Target.Offset(, 2) = Target.Offset(, -2) * Target * (-1) If Target.Column = 9 Then _ Target.Offset(, -2) = Target / Target.Offset(, -4) * (-1) Application.EnableEvents = True End Sub Thanks, Amir |
Code Works on Windows 2000 but not on XP
On Jul 20, 2:28 pm, Barb Reinhardt
wrote: I'm on 2003 (XP?) and it seems to work here. What's the problem? "amirstal" wrote: HI, Does anyone have an idea why this code works on Windows 2000 SP4 but not on XP??? Private Sub Worksheet_Change(ByVal Target As Range) Application.EnableEvents = False If Target.Address = "$G$10" Then _ Target.Offset(, 2) = Target.Offset(, -2) * Target * (-1) If Target.Address = "$I$2" Then _ Target.Offset(, -2) = Target / Target.Offset(, -4) * (-1) Application.EnableEvents = True If Target.Row < 10 Then Exit Sub Application.EnableEvents = False If Target.Column = 7 Then _ Target.Offset(, 2) = Target.Offset(, -2) * Target * (-1) If Target.Column = 9 Then _ Target.Offset(, -2) = Target / Target.Offset(, -4) * (-1) Application.EnableEvents = True End Sub Thanks, Amir The problem is that when I enter the first amount, it does not show the second amount automatically, like it does on Windows 2000. I have XP version 2002, SP2. Amir |
Code Works on Windows 2000 but not on XP
One problem I see is that it's that prone to crashing because of lack of
error checking there's a very good chance of leaving EnableEvents as false meaning the macro won't work at all after the first crash. Mike "amirstal" wrote: On Jul 20, 2:28 pm, Barb Reinhardt wrote: I'm on 2003 (XP?) and it seems to work here. What's the problem? "amirstal" wrote: HI, Does anyone have an idea why this code works on Windows 2000 SP4 but not on XP??? Private Sub Worksheet_Change(ByVal Target As Range) Application.EnableEvents = False If Target.Address = "$G$10" Then _ Target.Offset(, 2) = Target.Offset(, -2) * Target * (-1) If Target.Address = "$I$2" Then _ Target.Offset(, -2) = Target / Target.Offset(, -4) * (-1) Application.EnableEvents = True If Target.Row < 10 Then Exit Sub Application.EnableEvents = False If Target.Column = 7 Then _ Target.Offset(, 2) = Target.Offset(, -2) * Target * (-1) If Target.Column = 9 Then _ Target.Offset(, -2) = Target / Target.Offset(, -4) * (-1) Application.EnableEvents = True End Sub Thanks, Amir The problem is that when I enter the first amount, it does not show the second amount automatically, like it does on Windows 2000. I have XP version 2002, SP2. Amir |
Code Works on Windows 2000 but not on XP
On Jul 20, 2:48 pm, Mike H wrote:
One problem I see is that it's that prone to crashing because of lack of error checking there's a very good chance of leaving EnableEvents as false meaning the macro won't work at all after the first crash. Mike "amirstal" wrote: On Jul 20, 2:28 pm, Barb Reinhardt wrote: I'm on 2003 (XP?) and it seems to work here. What's the problem? "amirstal" wrote: HI, Does anyone have an idea why this code works on Windows 2000 SP4 but not on XP??? Private Sub Worksheet_Change(ByVal Target As Range) Application.EnableEvents = False If Target.Address = "$G$10" Then _ Target.Offset(, 2) = Target.Offset(, -2) * Target * (-1) If Target.Address = "$I$2" Then _ Target.Offset(, -2) = Target / Target.Offset(, -4) * (-1) Application.EnableEvents = True If Target.Row < 10 Then Exit Sub Application.EnableEvents = False If Target.Column = 7 Then _ Target.Offset(, 2) = Target.Offset(, -2) * Target * (-1) If Target.Column = 9 Then _ Target.Offset(, -2) = Target / Target.Offset(, -4) * (-1) Application.EnableEvents = True End Sub Thanks, Amir The problem is that when I enter the first amount, it does not show the second amount automatically, like it does on Windows 2000. I have XP version 2002, SP2. Amir Yes, that what happened. It crashed and now it won't work. How can I fix that problem? |
Code Works on Windows 2000 but not on XP
|
All times are GMT +1. The time now is 06:51 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com