Filling Blancks in Columns with the containing of cell.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi I would like to know how I can tell Exel to copy the cell above into the
actual cell if this is empty. If not empty, copy the value in the cell.
ex.

abcde abcde
abcde
fghij fghij
fghij
fghij
hjjkl hjjkl

and so on.
 
Enter this small macro:

Sub fill_in_the_blanks()
Dim r As Range
For Each r In Selection
If IsEmpty(r.Value) Then
r.Value = r.Offset(-1, 0).Value
End If
Next
End Sub

Then select the part of the column you want fixed.
Then run the macro.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top