Hi All,
I am probably running low on sugar and caffeine, the code below was working this morning and now I get the run-time error 50290 Method 'ScreenUpdating' of object '_Application' failed. I am more of a have a go hero than an expert so could use any help.
The code copies specific cells from one workbook to another when a checkbox is ticked.
Code
Sub UpdateOutstandingJobs() 'module20
Application.ScreenUpdating = False
Dim cBox As CheckBox
Dim lRow As Integer
Dim LColumn As Integer
LName = Application.Caller
Set cBox = ActiveSheet.CheckBoxes(LName)
'Find row that checkbox resides in
lRow = cBox.TopLeftCell.Row
LRange = "Q" & CStr(lRow)
Cells(lRow, "Q").Select
Range(ActiveCell.Offset(0, -10), ActiveCell.Offset(0, -16)).Copy
Workbooks.Open ("z:\AVS\OutstandingJobs.xlsx")
LastRow = Range("A" & Rows.Count).End(xlUp).Row + 1
Sheets("Sheet1").Range("A" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Workbooks("AVS.xlsm").Activate
Cells(lRow, "Q").Select
Range(ActiveCell.Offset(0, 9), ActiveCell.Offset(0, 11)).Copy
Workbooks("OutstandingJobs.xlsx").Activate
LastRow = Range("h" & Rows.Count).End(xlUp).Row + 1
Sheets("Sheet1").Range("h" & LastRow).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
CloseandSave
Workbooks("AVS.xlsm").Activate
Application.ScreenUpdating = True
End Sub
Display More