project manager15
New Member
- Joined
- Mar 11, 2009
- Messages
- 21
Hi,
I have writen a macro and it does what i want it to do but only for row '5' and i need it to go down to row 27.
It means that you can only edit e5 to k5 once O/C/A is pick from the drop down. ie i want people to fill in B5.
There are other cells inbetween but they cant be changed and are not relevent.
any help would be awesome.
can i attach?
mark
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("e5:k27")) Is Nothing And Target.Count = 1 Then
Select Case Range("b5").Value
Case "O"
Range("E5:K5").Font.ColorIndex = 1
Case "C"
Range("E5:K5").Font.ColorIndex = 1
Case "A"
Range("E5:K5").Font.ColorIndex = 1
Case Else
Range("E5:K5") = 0
Range("E5:K5").Font.ColorIndex = 2
Value = 0
MsgBox "PLEASE COMPLETE O/C/A"
End Select
End If
End Sub
I have writen a macro and it does what i want it to do but only for row '5' and i need it to go down to row 27.
It means that you can only edit e5 to k5 once O/C/A is pick from the drop down. ie i want people to fill in B5.
There are other cells inbetween but they cant be changed and are not relevent.
any help would be awesome.
can i attach?
mark
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("e5:k27")) Is Nothing And Target.Count = 1 Then
Select Case Range("b5").Value
Case "O"
Range("E5:K5").Font.ColorIndex = 1
Case "C"
Range("E5:K5").Font.ColorIndex = 1
Case "A"
Range("E5:K5").Font.ColorIndex = 1
Case Else
Range("E5:K5") = 0
Range("E5:K5").Font.ColorIndex = 2
Value = 0
MsgBox "PLEASE COMPLETE O/C/A"
End Select
End If
End Sub