Hi All,
I have the below but cant get it to work.
Column A is a date field and when someone adds a date Column B shows the month same logic in Column L and M. If i just have the first sub it works fine but when i add the second it stops working. Reason for this is that the sheet is filled in my many people and i display the month in a separate sheet so trying to avoid anyone deleting formulas but also not having formulas hard coded to keep the file size down.
I would like to actually have this set the Month in Column B then remove the formula and leave the month again to keep the file size down0. Hopefully i have been clear enough please help......
Private Sub Scanned_Date(ByVal Target As Range)
Dim B As Range, A As Range, t As Range
Set B = Range("B:B")
Set A = Range("A:A")
Set t = Target
If Intersect(t, A) Is Nothing Then Exit Sub
Application.EnableEvents = False
Range("B" & t.Row).Value = "=IF(RC[-1]="""","""",MONTH(RC[-1]))"
Application.EnableEvents = True
End Sub
Private Sub Rejected_Date(ByVal Target As Range)
Dim M As Range, L As Range, t As Range
Set M = Range("M:M")
Set L = Range("L:L")
Set t = Target
If Intersect(t, L) Is Nothing Then Exit Sub
Application.EnableEvents = False
Range("M" & t.Row).Value = "=IF(RC[-1]="""","""",MONTH(RC[-1]))"
Application.EnableEvents = True
End Sub
I have the below but cant get it to work.
Column A is a date field and when someone adds a date Column B shows the month same logic in Column L and M. If i just have the first sub it works fine but when i add the second it stops working. Reason for this is that the sheet is filled in my many people and i display the month in a separate sheet so trying to avoid anyone deleting formulas but also not having formulas hard coded to keep the file size down.
I would like to actually have this set the Month in Column B then remove the formula and leave the month again to keep the file size down0. Hopefully i have been clear enough please help......
Private Sub Scanned_Date(ByVal Target As Range)
Dim B As Range, A As Range, t As Range
Set B = Range("B:B")
Set A = Range("A:A")
Set t = Target
If Intersect(t, A) Is Nothing Then Exit Sub
Application.EnableEvents = False
Range("B" & t.Row).Value = "=IF(RC[-1]="""","""",MONTH(RC[-1]))"
Application.EnableEvents = True
End Sub
Private Sub Rejected_Date(ByVal Target As Range)
Dim M As Range, L As Range, t As Range
Set M = Range("M:M")
Set L = Range("L:L")
Set t = Target
If Intersect(t, L) Is Nothing Then Exit Sub
Application.EnableEvents = False
Range("M" & t.Row).Value = "=IF(RC[-1]="""","""",MONTH(RC[-1]))"
Application.EnableEvents = True
End Sub