Raju Nagavelli
New Member
I should be able to cells with certain strings in J Column, and whenever I change text in J column the auto date should be updated in next column cell. for example, if I change the text in J3 column then the change date should be updated in column cell like (L3,M3,N3 and O3 ) and locked. So I should be able to change the text in 5 times and 5 auto dates should be updated. After that I should not be allowed to edit that particular cell after 5 changes.
Here is the code and you find the file in the attachment.
>>> use code - tags <<<
	
	
	
		
				
			Here is the code and you find the file in the attachment.
>>> use code - tags <<<
		Code:
	
	Private Sub Worksheet_Change(ByVal Target As Range)
   
    Dim x As Integer
   
    x = 2
    With Sheets("sheet2")
        .Unprotect "test"
        .Cells.Locked = False
    End With
   
    For x = 2 To 32
        If WorksheetFunction.CountA(Range(Cells(x, 1), Cells(x, 10))) <> 0 And Cells(x, 11).Value = "" Then
            Cells(x, 11).Value = Date
        Else: GoTo ende
        End If
        ende:
    Next x
    Call nottoday
End Sub
Sub nottoday()
    For x = 2 To 32
        If IsDate(Cells(x, 11).Value) And Cells(x, 11).Value < Date Then
            ActiveSheet.Unprotect Password:="test"
            Range(Cells(x, 1), Cells(x, 11)).Locked = True
        End If
    Next x
    Sheets("Sheet2").Protect "test"
End Sub
	Attachments
			
				Last edited by a moderator: