F
Freshman
Dear experts/Bernie Deitrick
Bernie wrote me the code below for transferring records from one sheet to
another and it works perfectly well in my PC. However, when I put the file
into a common network drive and share with other users inside my Company, the
code only work in my PC and not in other users' PCs. Is the code below has
some restriction to my PC only? If yes, how to modify the code so that the
file can be used by other users.
Please advise and thanks in advance.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myCell As Range
On Error GoTo ErrorHandler
Application.EnableEvents = False
If Target.Column = 4 And Target(1).Value = "Y" Then
Dim eRow As Long
eRow = Sheets("Completed").Cells(Rows.Count, 1).End(xlUp).Row + 1
For Each myCell In Target
myCell.Offset(0, -3).Resize(, 4).Copy _
Sheets("Completed").Cells(eRow, 1)
eRow = eRow + 1
Next myCell
Target.EntireRow.Delete
End If
ErrorHandler:
Application.EnableEvents = True
End Sub
Bernie wrote me the code below for transferring records from one sheet to
another and it works perfectly well in my PC. However, when I put the file
into a common network drive and share with other users inside my Company, the
code only work in my PC and not in other users' PCs. Is the code below has
some restriction to my PC only? If yes, how to modify the code so that the
file can be used by other users.
Please advise and thanks in advance.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myCell As Range
On Error GoTo ErrorHandler
Application.EnableEvents = False
If Target.Column = 4 And Target(1).Value = "Y" Then
Dim eRow As Long
eRow = Sheets("Completed").Cells(Rows.Count, 1).End(xlUp).Row + 1
For Each myCell In Target
myCell.Offset(0, -3).Resize(, 4).Copy _
Sheets("Completed").Cells(eRow, 1)
eRow = eRow + 1
Next myCell
Target.EntireRow.Delete
End If
ErrorHandler:
Application.EnableEvents = True
End Sub