ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem with Worksheet_Change event (https://www.excelbanter.com/excel-programming/288198-problem-worksheet_change-event.html)

Romuald

Problem with Worksheet_Change event
 
I use the Worksheet_Change(ByVal Target AS Excel.Range) event to update input values (I replace "-" character with 0) on Office 97 (NT4)
For most of the computers, the Target.Value is equal to the value

But on some computer the new value is not available. Indeed, the Target.Value is still equal to previous value of the cell

Example
So when I have a cell equal to
The user inputs 1
The event replaces the - with 0 instead of keeping 1

What's the problem? Thanks for email me your response to

Many thanks for your help



Bob Phillips[_6_]

Problem with Worksheet_Change event
 
Romuald,

Post the code.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Romuald" wrote in message
...
I use the Worksheet_Change(ByVal Target AS Excel.Range) event to update

input values (I replace "-" character with 0) on Office 97 (NT4).
For most of the computers, the Target.Value is equal to the value.

But on some computer the new value is not available. Indeed, the

Target.Value is still equal to previous value of the cell.

Example :
So when I have a cell equal to -
The user inputs 12
The event replaces the - with 0 instead of keeping 12

What's the problem? Thanks for email me your response to

!

Many thanks for your help!





Romuald

Problem with Worksheet_Change event
 
hi

here the following code

Private Sub Worksheet_Change(ByVal Target As Excel.Range
On Error GoTo trt_Error

Dim sValue As String, i As Long, j As Lon

If Not blnDeActivateChangeEvent The
blnDeActivateChangeEvent = Tru
If Not mdlScreen_Display.IsBuildingScreen The
' Gestion des modes particuliers pour les saisie
If Me.cbxRefreshOnComboChange.value The
If Target.Count = 1 The
' Remplace les Missings pas des
If Val(SYReplace(Cells(Target.Row, Target.Column).value, ",", ".")) = 0 The
Cells(Target.Row, Target.Column).value =
End I
inputValues = inputValues & ConvColToASCII(Target.Column) & Target.Row & "=" & Target.value & ";
Els
' Sélection multipl
For i = Target.Column To Target.Column + Target.Cells.Columns.Count -
For j = Target.Row To Target.Row + Target.Cells.Rows.Count -
' Remplace les Missings pas des
If Val(SYReplace(Cells(Target.Row, Target.Column).value, ",", ".")) = 0 And Not bMODE_DisableReplaceMissing The
Cells(j, i).value =
End I
inputValues = inputValues & ConvColToASCII(i) & j & "=" & Cells(j, i).value & ";
Nex
Nex
End I
Els
MsgBox "Input data cannot be saved when the auto-refresh is disabled." & vbCr
& "Enable auto-refresh before you enter your data.", vbCritical, "Unable to input data
End I
End I
blnDeActivateChangeEvent = Fals
End I

trt_Exit
Exit Su
trt_Error
Resume trt_Exit
End Su


An idea?


All times are GMT +1. The time now is 12:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com