View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default count cells if ""


Dim cell as Range, rng as Range
for each cell in Range("A1:A200")
set rng = Cell.offset(0,1).Resize(1,32)
if Application.countA(rng) = 32 then
cell.offset(0,1).Resize(1,32).Value = "MyValue"
End if
Next

for 44
Dim cell as Range, rng as Range
for each cell in Range("A1:A200")
set rng = Cell.offset(0,1).Resize(1,44)
if Application.countA(rng) = 44 then
cell.offset(0,1).Resize(1,44).Value = "MyValue"
End if
Next

--
Regards,
Tom Ogilvy



"hotherps " wrote in message
...
I need to check a row to see if there are at least 32 or 44 cells
specifically to the right that are ""
If so, I want to fill the cells with a text value "MyValue"

If there is any other number of cells including zero that are "", I
want to skip that row and go to the next one.

Just can't get it

Thanks


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