Ok here we go... I am sure that I am doing this wrong but this is what I would like to do.
You will see in the image below an X in the column that says MU (make up time) and then of course the coresponding time would be put a column between F - L on the same row. Now there could be more than one instance of MU time so I would like to place the values in column Z and the row they are in. But the for loop I have seems to run in a infinite loop. Any help would be appreciated....
Code:Private Sub Worksheet_Change(ByVal Target As Range) Dim col(7) As String, newvalue col(1) = "F" col(2) = "G" col(3) = "H" col(4) = "I" col(5) = "J" col(6) = "K" col(7) = "L" For i = 3 To 46 For k = 1 To 6 If Range("Q" & i).Value <> "" And Range(col(k) & i).Value >= 1 Then 'Sheets("Monday").Range("A1").Value = -Range(col(k) & i).Value newvalue = Range(col(k) & i).Value Sheets("Monday").Range("z" & i).Value = Range(col(k) & i).Value 'MsgBox newvalue Exit For End If Next Next theend: End Sub






Reply With Quote