rjplante
Well-known Member
- Joined
- Oct 31, 2008
- Messages
- 574
- Office Version
- 365
- Platform
- Windows
I have the change macro listed below that flags a run time error 13 type mismatch when a merged cell is changed. Any thoughts?
Thanks,
Robert
Thanks,
Robert
Rich (BB code):
Dim PreviousValue
Private Sub Worksheet_Change(ByVal Target As Range)
'If signed indicator is P then abort.
If ThisWorkbook.Sheets("QC5003.4A-1 FINAL QC CONICAL").Range("U46").Value <> "C" Then
Exit Sub
ElseIf Target.Value <> PreviousValue Then
'Suspends display updates as the macro executes.
Application.ScreenUpdating = False
'Makes the Audit Log Bag worksheet visible and active.
ThisWorkbook.Sheets("Audit Log Conicals").Visible = True
ThisWorkbook.Sheets("Audit Log Conicals").Activate
'Enters the password to unlock the worksheet and allow data entry.
ThisWorkbook.ActiveSheet.Unprotect Password:="bioe1025"
'Adds the username to the second column in the first available row.
ThisWorkbook.Sheets("Audit Log Conicals").Cells(65000, 2).End(xlUp).Offset(1, 0).Value = Sheets("Intro Page").Range("R15").Value
ThisWorkbook.Sheets("Audit Log Conicals").Cells(65000, 2).End(xlUp).Select
ActiveCell.Offset(0, 1).Value = Date 'Enters the date in the next cell
ActiveCell.Offset(0, 2).Value = Time 'Enters the time in the next cell.
ActiveCell.Offset(0, 3).Value = Sheets("QC5003.4A-1 FINAL QC CONICAL").Name 'Enters the sheet name in the next cell.
ActiveCell.Offset(0, 4).Value = Target.Address 'Enters the cell name in the next cell.
ActiveCell.Offset(0, 5).Value = PreviousValue 'Enters the previous value of the cell.
ActiveCell.Offset(0, 6).Value = Target.Value 'Enters the new value of the cell.
'Enters the password to protect the workbook.
ThisWorkbook.ActiveSheet.Protect Password:="bioe1025"
'Hides the Audit Log Bag worksheet.
ThisWorkbook.Sheets("Audit Log Conicals").Visible = False
'Makes the QC5003.4A-1 FINAL QC CONICAL the active sheet.
ThisWorkbook.Sheets("QC5003.4A-1 FINAL QC CONICAL").Activate
'Restores display updates
Application.ScreenUpdating = True
End If
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
PreviousValue = Target.Value
End Sub