I am trying to lock a set of cells values using VBA but only if the last cell in the block is a formula and a date. So in the file i attached it would be cell BH4 and the cells that need to be lock would be all of Rows 4,5,6,7,8. But i need it to find amoung all cell in the BH coloumn. The actual file goes all the way to BH1978. Thank you in advace. Also the sheet I attached has had some informtion deleted so that personal infromation would be removed.![]()
Sub test2() Do Dim X As Integer Dim I As Integer Dim V As Integer For X = 1228 To 1977 X = X + 7 Next For I = 1233 To 1982 I = I + 7 Next For V = 1299 To 2048 V = V + 7 Next Dim Locationone As String Locatonone = "BH" & X Dim Locationtwo As String Locationtwo = "A" & X & ":" & "BH" & I Dim Locationthree As String Locationthree = "A" & V If Range(Locationone).Value = IsBlank Then Else Range(Locationtwo).Value = Range(Locationtwo).Value Range(Locationthree).Value = Range(Locationthree).Value End If Loop End Sub
Bookmarks