View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
hotherps[_105_] hotherps[_105_] is offline
external usenet poster
 
Posts: 1
Default Values run out of range

Hi I'm using the following code, that places text values in a row a
specific points in the row. The problem is that sometimes the value
exceed the range of the defined range that I'm working in

The overall range is G11:CX15

But if a cell has a value greater than "" and that value is less tha
32 cells from end of the range. It will start adding values out of th
range.

Is there a way I can make the code stopanytime it tries to go beyond C
?

Thanks.

For Each cell In Range("G11:CP287")
If cell.Value "" Then
If (cell.Offset(0, -1) = "") Then
cell.Offset(0, 7).Value = "Brk"
cell.Offset(0, 14).Value = "Lun"
cell.Offset(0, 15).Value = "Lun"
cell.Offset(0, 24).Value = "Brk"

End If
End I

--
Message posted from http://www.ExcelForum.com