View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Looping through cell

Sub foo()
Dim rng1 As Range
Set rng1 = Range(ActiveCell, Cells(Rows.Count, ActiveCell.Column).End(xlUp))
For Each cell In rng1
If cell.Value = "" Then
cell.Value = "NA"
End If
Next cell
End Sub


Gord Dibben MS Excel MVP


On 27 May 2007 11:14:11 -0700, " wrote:

This has to have been addressed before but I'm having some problems
and I was hoping a guru could help me.

I have a column whose row size is variable. In some of the cells for
that column, there is a blank or null value. I want to place NA in
that value and iterate through the cell until the end.

I seem to be able to get the columns row size but I can't seem to
iterate through each cell and check for the null value.

Here is an example of the row:
J
--------
Mod%

.123
.345
.234

.234

.234 [end]