snowboy001
Board Regular
- Joined
- Dec 5, 2009
- Messages
- 100
I was wondering if I could modify this code so that it only active for columns "E:K". Any ideas???
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Value1 As Single
Dim Value2 As Single
Value1 = Range("Y1").Value
Value2 = Range("X1").Value
If Value1 > Value2 Then
Target.ClearComments
Target.Interior.ColorIndex = 8
On Error Resume Next
Dim curComment As String
curComment = ""
curComment = Target.Comment.Text
If curComment <> "" Then curComment = curComment & Chr(10)
Target.AddComment
Target.Comment.Text Text:=curComment & _
ActiveWorkbook.BuiltinDocumentProperties("Author") & _
Chr(10) & " Rev. " & Format(Time, "hh:mm") & _
" " & Format(Date, "mm/dd/yyyy")
Sheets("Sheet2").Range("A1").FormulaR1C1 = "1"
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Value1 As Single
Dim Value2 As Single
Value1 = Range("Y1").Value
Value2 = Range("X1").Value
If Value1 > Value2 Then
Target.ClearComments
Target.Interior.ColorIndex = 8
On Error Resume Next
Dim curComment As String
curComment = ""
curComment = Target.Comment.Text
If curComment <> "" Then curComment = curComment & Chr(10)
Target.AddComment
Target.Comment.Text Text:=curComment & _
ActiveWorkbook.BuiltinDocumentProperties("Author") & _
Chr(10) & " Rev. " & Format(Time, "hh:mm") & _
" " & Format(Date, "mm/dd/yyyy")
Sheets("Sheet2").Range("A1").FormulaR1C1 = "1"
End If
End Sub