Hi I am new to macros. i intend towrite a code that does the following action.
It selects cells in column B which has same value as input in dialogbox (line no.)
the line number occurs three or more times in succession and then changes to the next line number. so I want the next loop now to be fill in the dialog box info from column C if it is empty and the it loops until there is a change in line number in column B.
This is the code I have used but unfortunately it fills out all the rows of the particular line no. I want it to fill just one at a time and stop.
Please can you help !
Private Sub CmdOK_Click()
ActiveWorkbook.Sheets("Daily report Fab 1&2").Activate
If cboLijn.Value = "L01" Then
Range("C3").Select
For i = 3 To 7
If Range("C" & i).Value = False Then
Range("C" & i).Value = txtReferentie.Value
Range("D" & i).Value = cboChocolateType.Value
Range("E" & i).Value = cboUnscheduledHours.Value
End If
Next i
End If
End Sub
It selects cells in column B which has same value as input in dialogbox (line no.)
the line number occurs three or more times in succession and then changes to the next line number. so I want the next loop now to be fill in the dialog box info from column C if it is empty and the it loops until there is a change in line number in column B.
This is the code I have used but unfortunately it fills out all the rows of the particular line no. I want it to fill just one at a time and stop.
Please can you help !
Private Sub CmdOK_Click()
ActiveWorkbook.Sheets("Daily report Fab 1&2").Activate
If cboLijn.Value = "L01" Then
Range("C3").Select
For i = 3 To 7
If Range("C" & i).Value = False Then
Range("C" & i).Value = txtReferentie.Value
Range("D" & i).Value = cboChocolateType.Value
Range("E" & i).Value = cboUnscheduledHours.Value
End If
Next i
End If
End Sub