On one of my PCs, after I run a subroutine via a command button, i am then unable to key in data into some cells. No error message comes up - I can select the cells, but it's as if the keyboard isn't working, but only after the VBA code is run.
The strange thing is that this is only an issue on one of the PCs!
All PCs running windows 10, excel 2016, exact same excel file. (Problem PC has a second monitor.)
Code for sub routine that causes the issue: Note: i have since changed the else's to elseif 's , but can only retest on the problem PC on Monday.
[code]
Private Sub locksave_Click()
Application.ScreenUpdating = False
'check lock,save allready done?
If Range("bb4").Value = "locked" Then
MsgBox "data is allready locked"
Else:
'check data is entered
If Range("ba26") = "no" Then
MsgBox "There is missing data, please correct."
Else:
'check inspector is authorised
If Range("aj8") = "O" Then
MsgBox "The inspector is not authorised, please correct."
Else:
'check calibration value is correct
If Range("k9") = "O" Then
MsgBox "The calibration value is not between 1.98 and 2.02mm. Please re-calibrate, and repeat the measurements"
Range("e15:ab15, af14:am14").Select
Selection.ClearContents
Else:
'check that quuarrantine details are entered
If (Range("x44") = "O" And Range("s48") = "") Then
MsgBox "An item is out of tolerance. Please enter quarrantine details. State what lengths are to be scrapped or quarrantined. Typically, all tubes produced since the last good sample are to be quarrantined."
Else:
'check for corrective action plan
If (Range("m44") = "O" Or Range("x44") = "O") And Range("e48") = "" Then
MsgBox "Please enter a corrective action plan."
Else:
ActiveSheet.unprotect Password:="protect"
ActiveSheet.UsedRange.Locked = False
'insert date and time into data entry form and data summary
Application.ScreenUpdating = False
Range("Di1").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues
Range("X26").Select
'make columns fit to data
Columns("DD:Ep").Select
Columns("DD:Ep").EntireColumn.AutoFit
'set bb4 to locked
Range("bb4").Value = "locked"
'set all cells in worksheet to locked
ActiveSheet.UsedRange.Locked = True
'disable toggle buttons for undercut etc.
Dim Ctrl As OLEObject
For Each Ctrl In ActiveSheet.OLEObjects
With Ctrl
If TypeName(.Object) = "ToggleButton" Then
.Object.Enabled = False
End If
End With
Next Ctrl
'protect worksheet
ActiveSheet.Protect Password:="protect", UserInterfaceOnly:=True
'save
ActiveWorkbook.save
MsgBox ("saved")
End If
End If
End If
End If
End If
End If
End Sub
[code/]
Bookmarks