Whenever I double click on any cell of any workbook (existing or new) excel opens a specific file on its own!!
I have been playing around with this code today;
Not sure if this is the cause, if not, how can I fix this?
Thanks in advance
I have been playing around with this code today;
Code:
Sub Auto_Open()
On Error Resume Next
Application.OnDoubleClick = "updateFromLeft"
End Sub
Sub updateFromLeft()
Dim WasProtected As Boolean
On Error GoTo myhandler
If ActiveCell.Row = 4 And ActiveCell.Column > 9 And ActiveCell.Column < 40 Then
Dim response As VbMsgBoxResult
response = MsgBox("Are you sure you want to copy yesterday's data over?", vbYesNo)
If response = vbNo Then Exit Sub
If ThisWorkbook.ActiveSheet.ProtectContents = True Then
ThisWorkbook.ActiveSheet.Unprotect Password:="grange"
WasProtected = True
Else
WasProtected = False
End If
ActiveCell.Offset(, -1).EntireColumn.Copy Destination:=ActiveCell.EntireColumn
If WasProtected Then ThisWorkbook.ActiveSheet.Protect Password:="grange"
Exit Sub
Else
Application.SendKeys "{F2}"
Exit Sub
End If
myhandler:
If Application.ScreenUpdating <> True Then Application.ScreenUpdating = True
Application.SendKeys "{F2}"
End Sub
Not sure if this is the cause, if not, how can I fix this?
Thanks in advance