N
Noemi
Hi
I have a code which as Target.Address which works in Excel 2000 but will not
work in excel 98.
Does anyone know what code to use for when a workbook change is to take
affect.
The current code which works in Excel 2000 is below:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$G$26" Then
If Range("G26") = "Other" Then
ActiveSheet.Unprotect
Sheets("Recording Sheet").Range("E28") = "Please speficy:"
Sheets("Recording Sheet").Range("G28:I28").Interior.ColorIndex = 2
Sheets("Recording Sheet").Range("G28:I28") = ""
Sheets("Recording Sheet").Range("G28:I28").Locked = False
ActiveSheet.Protect
Sheets("Recording Sheet").Range("G28:I28").Select
ElseIf Range("G26").Value = "" Then
ActiveSheet.Unprotect
Sheets("Recording Sheet").Range("E28") = ""
Sheets("Recording Sheet").Range("G28:I28") = ""
Sheets("Recording Sheet").Range("G28:I28").Interior.ColorIndex = 1
Sheets("Recording Sheet").Range("G28:I28").Locked = True
ActiveSheet.Protect
Else
ActiveSheet.Unprotect
Sheets("Recording Sheet").Range("E28") = ""
Sheets("Recording Sheet").Range("G28:I28") = ""
Sheets("Recording Sheet").Range("G28:I28").Interior.ColorIndex = 1
Sheets("Recording Sheet").Range("G28:I28").Locked = True
ActiveSheet.Protect
End If
End If
End Sub
Any help would be appreciated.
Thanks
Noemi
I have a code which as Target.Address which works in Excel 2000 but will not
work in excel 98.
Does anyone know what code to use for when a workbook change is to take
affect.
The current code which works in Excel 2000 is below:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$G$26" Then
If Range("G26") = "Other" Then
ActiveSheet.Unprotect
Sheets("Recording Sheet").Range("E28") = "Please speficy:"
Sheets("Recording Sheet").Range("G28:I28").Interior.ColorIndex = 2
Sheets("Recording Sheet").Range("G28:I28") = ""
Sheets("Recording Sheet").Range("G28:I28").Locked = False
ActiveSheet.Protect
Sheets("Recording Sheet").Range("G28:I28").Select
ElseIf Range("G26").Value = "" Then
ActiveSheet.Unprotect
Sheets("Recording Sheet").Range("E28") = ""
Sheets("Recording Sheet").Range("G28:I28") = ""
Sheets("Recording Sheet").Range("G28:I28").Interior.ColorIndex = 1
Sheets("Recording Sheet").Range("G28:I28").Locked = True
ActiveSheet.Protect
Else
ActiveSheet.Unprotect
Sheets("Recording Sheet").Range("E28") = ""
Sheets("Recording Sheet").Range("G28:I28") = ""
Sheets("Recording Sheet").Range("G28:I28").Interior.ColorIndex = 1
Sheets("Recording Sheet").Range("G28:I28").Locked = True
ActiveSheet.Protect
End If
End If
End Sub
Any help would be appreciated.
Thanks
Noemi