On Dec 20, 6:09 am, carlo wrote:
the problem is, if A1 is empty, A2 will be filled by empty and so on!
I'm not sure if "cell" is a reserved vba word, but I would try mycell
or cell_ as variable, to avoid problems.
Otherwise it should work.
Cheers Carlo
On Dec 20, 12:55 pm, Susan wrote:
Hi,
I know this topic has already been posted and since I don't know VB
excel programming, I used the code from a previous post to achieve
what i want.
I need to search for blank values in a range and replace them with the
value above.
My code:
Sub BlankRepeats()
For Each cell In Range("A2:A35")
If cell.Value = "" Then
cell.Value = cell.Offset(-1, 0).Value
End If
Next cell
End Sub
It iterates through the entire range and doesnt seem to pick up any
values as though all are blanks and hence no changes are made.
Meanwhile the column A has text values in many rows.
Will appreciate some help.
Thanks
Susan
Hi,
Thanks for responding.
Do you mean I should put in the statement 'dim cell as variable' or?
Anyway I tried that; still doesnt work.
I use 'cell' in the for loop of other functions of this same worksheet
and it works fine.
At the moment A1 is not blank.
Could it be sumthing with the type of value in the cell? does it make
a difference whether its text or numbers?
Thanks
Susan