I'm currently have this formula to populate the cells according to date. I would like to convert the formula to VBA.
I try to write some codes, but don't know how to allow the codes to read until the end. I also need to insert value ("1.1") under each date that meets the requirement.
Private Sub CommandButton1_Click() Dim date1 As Long, date2 As Long, date3 As Long, result As String date1 = Range("O7").Value date2 = Range("P7").Value date3 = Range("C1").Value If score3 >= score1 And score3 <= score2 Then result = "1.1" Else result = "x" End If Range("C2").Value = result End Sub
I need the VBA to continue read through the whole row and compare with Start/End dates. If the dates in row are within Start/End dates, then insert value "1.1".
I have attached the file to show what i want to do.