Copy cell - fill all blank - multiple range

G

Guest

In excel 2002, when i select a cell with blank cells beneath and rest the mouse pointer in the bottom left corner so it changes to a + sign by double clicking this will copy the cell contents downwards until the next cell with anything inputted.
If im working with a very large amount of data and would like to repeat this many times within one column - is there a way to ask for cell info to be copied downwards whenever there is blank cells?
 
N

Nick Hodge

Dave

Not easily with a worksheet function, but the code below, pasted into you
personal.xls workbook and assigned to a shortcut key or similar, will fill
the blank cells below any data with the data above. It works on you
selecting the whole of the data before you run it. It will see results of
formulae as ordinary data too.

Sub FillBlanksBelowData()
Dim mycell As Range
Dim vCellVal As Variant
For Each mycell In Selection
If mycell.Value <> "" Then
vCellVal = mycell.Value
Else
mycell.Value = vCellVal
End If
Next mycell
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)


Copy Dave said:
In excel 2002, when i select a cell with blank cells beneath and rest the
mouse pointer in the bottom left corner so it changes to a + sign by double
clicking this will copy the cell contents downwards until the next cell with
anything inputted.
If im working with a very large amount of data and would like to repeat
this many times within one column - is there a way to ask for cell info to
be copied downwards whenever there is blank cells?
 

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

Top