List of blank and non-blank cells
I'm assuming -blank- means empty and not "-blank-".
Here's one way:
Sub test()
For Each cell In Range("A1:A7")
If cell.Value = "" Then cell.Value = cell.Offset(-1, 0).Value
Next cell
End Sub
Regards,
Paul
"Mirja" wrote in message
...
Hello,
I have a list that looks as follows:
1012
-blank-
-blank-
1013
-blank-
-blank-
-blank-
and so forth.
What I like to do, is to get a VBA command that fills the blank cells with
the above value until the next value is reached. In this example, first
two
blanks with "1012", the other blanks with "1013" until the end of the list
is
reached. The end of the list is reached, when there are no more values in
the
next column (lets say column B).
Can anybody help?
Thanks in advance!
Mirja
|