M
mikewild2000
This is the problematic code.
It only gives the error when in shared mode. i think it may need a "Xl"
somewhere???
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Excel.Range)
Application.EnableEvents = False
Application.ScreenUpdating = False
If Target.Column >= 2 And Target.Column <= 10 And Target.Row >= 5 And
Target.Row <= 9 Then
Set ws1 = Worksheets(1)
For x = 10 To 19
score = ws1.Cells(x, 12).Value
scoreRow = x
For y = x + 1 To 19
If ws1.Cells(y, 12).Value > score Then
score = ws1.Cells(y, 12).Value
scoreRow = y
End If
Next y
If scoreRow <> x Then
ws1.Cells(scoreRow, 11).Cut
ws1.Cells(x, 11).Insert
ws1.Cells(scoreRow, 12).Cut
ws1.Cells(x, 12).Insert
End If
Next x
End If
ThisWorkbook.Save
Application.ScreenUpdating = True
Application.EnableEvents = True
end sub.
any help would be great.
PS; i do use shared mode.
It only gives the error when in shared mode. i think it may need a "Xl"
somewhere???
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Excel.Range)
Application.EnableEvents = False
Application.ScreenUpdating = False
If Target.Column >= 2 And Target.Column <= 10 And Target.Row >= 5 And
Target.Row <= 9 Then
Set ws1 = Worksheets(1)
For x = 10 To 19
score = ws1.Cells(x, 12).Value
scoreRow = x
For y = x + 1 To 19
If ws1.Cells(y, 12).Value > score Then
score = ws1.Cells(y, 12).Value
scoreRow = y
End If
Next y
If scoreRow <> x Then
ws1.Cells(scoreRow, 11).Cut
ws1.Cells(x, 11).Insert
ws1.Cells(scoreRow, 12).Cut
ws1.Cells(x, 12).Insert
End If
Next x
End If
ThisWorkbook.Save
Application.ScreenUpdating = True
Application.EnableEvents = True
end sub.
any help would be great.
PS; i do use shared mode.