View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
hotherps[_12_] hotherps[_12_] is offline
external usenet poster
 
Posts: 1
Default Problem incrementing rows

This code almost does what I need, but I'm stuck.
When I run this each cell that matches increments by two. I want to
keep the same value for the whole row. Then drop a row and increment by
two on the next row.

Example:
(Do not want)
Pack112 Pack114 Pack116
(Do want)
Pack112 Pack112 Pack112
Pack114 Pack114 Pack114

i = 112
For Each CELL In Range("A1:DD267")
If CELL.Value = "PACK" Then
i = i + 2

CELL.Value = "PACK" & CStr(i)

If i 140 Then i = 0

End If
Next CELL

Thanks



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