ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Problem with function "Worksheet_Change" (https://www.excelbanter.com/excel-worksheet-functions/32065-problem-function-%22worksheet_change%22.html)

konpego

Problem with function "Worksheet_Change"
 
Hello,

I have noticed some problems with the function "Worksheet_Change" between
different MS Excel versions.
Personally, I have the version: MS Excel 2000 (9.0.6926 SP-3)
and in this version there is NO problem.
A customer, though, works with the two versions:
MS Excel 2002 SP-1 and MS Excel 2003 SP-1
and he has noticed that when he selects a cell and changes it, the focus
(the frame
is marked) wil not be moved to the next cell after the change (and ENTER).
It is strange but it works perfectly fine in the older version.

Has anyone else experienced the same thing?
Solutions? Tips or tricks?

Below my Change function is listed. The problem occurs when the cell selection
is within the defined NAME-area "Product_Area".

Ideas anyone?

Thanks (in advance)!

/konpego

===========================================
Private Sub Worksheet_Change(ByVal Target As Range)
Dim sTargetArea As String
Dim rTarget As Range
Dim nRow As Long

On Error GoTo ERR_PROC
' ---------------- Check if change of Product list data ----------------
sTargetArea = Mid(Application.Names("Product_Area").Value, 2)
Set rTarget = Application.Intersect(Target, Range(sTargetArea))
If Not rTarget Is Nothing Then
Application.Cursor = xlWait
FormatWs_SalesSCoSaL
GoTo EXIT_PROC
End If
' -------------------- Check if change of TW data ---------------------
nRow = Target.Row
If IsEmpty(ActiveSheet.Cells(nRow, 3)) Then
Exit Sub ' no product assigned (n C
column)
End If

sTargetArea = Mid(Application.Names("Project_TW_Area").Value, 2)
Set rTarget = Application.Intersect(Target, Range(sTargetArea))
If Not rTarget Is Nothing Then
cmdUpdateProjectTimeWindow.Enabled = True
GoTo EXIT_PROC
End If



All times are GMT +1. The time now is 11:52 PM.

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