Possibly
If .Cells(x, skilly).Value = "x" And did = False Then
For y = timeStart To timeStart + 7
If .Cells(x, y).Value = "." _
And counter <= 6 _
And need 0 Then
Cells(x, y).Value = "ENG"
Elseif Counter 6 then
Cells(x,y).Value = "ENG"
End if
counter = counter + 1
need = need - 1
End If
Next y
End If
However, if you will always fill in 8 cells then this might be easier:
If .Cells(x, skilly).Value = "x" And did = False and Need 0 and _
.Cells(x,TimeStart) = "." Then
.Cells(x,TimeStart).Resize(1,8).Value = _
Array("ENG","ENG","ENG","ENG","ENG","ENG","TEST"," TEST")
End if
--
Regards,
Tom Ogilvy
"hotherps " wrote in message
...
I have the following code that works well:
If .Cells(x, skilly).Value = "x" And did = False Then
For y = timeStart To timeStart + 7
If .Cells(x, y).Value = "." _
And counter < 6 _
And need 0 Then
Cells(x, y).Value = "ENG"
counter = counter + 1
need = need - 1
End If
Next y
End If
What I want to is insert a text value "Test" into cells 7 and 8.
You can see the counter stops placing the value after 6 times I want to
fill in the next 2 cells after that with a fixed string value.The result
would look like:
Eng Eng Eng Eng Eng Eng Test Test
Thanks
---
Message posted from http://www.ExcelForum.com/