How can I fill blank cells in a list with previous filled value?

E

EMB

Frequently I get files with columns of data. If the value before is the
same, the value is blank in the current cell and other rows - if still
same....HIP - so below 64610927 should be on 2 more lines, and 64511495
should be on 3 more lines. How can I fill in those values. So far I can
only do it for one blank value. My file is long and this can be time
consuming.....

64610927
64603442
64610927


64610927
64511495



64610891
64607271
64610891
64614036
64611495
 
J

Jacob Skaria

The below method will work only if the cells are genuine blanks...

--Select a unused cell say E2
--Enter the formula in cell E2 which references the top cell (=E1)
--Copy the cell
--Keeping the copy select the data range in ColA
--Press F5. From Goto window select blanks
--This will select all blanks.. Now Right click>PasteSpecial>Formulas. will
fill in with the data you need..
--Once done you can select col A > Copy >PasteSpecial>Values to turn
formulas to actual values


If the above doesnt work then try the below macro..(if
the data is imported from some other source it may not be the case.)

Sub MyMacro()
Dim lngRow As Long
For lngRow = 2 To Cells(Rows.Count, "B").End(xlUp).Row
If Trim(Range("A" & lngRow)) = "" Then _
Range("A" & lngRow) = Range("A" & lngRow - 1)
Next
End Sub

If this too doesnt work post sample data...

If this post helps click Yes
 
P

Pete_UK

Highlight the column with those numbers in, and press F5 (GoTo), then
click Special and click on Blanks. You should see only the blank cells
highlighted, with the first blank cell as the active cell. Then begin
to enter a formula by typing = and then click on the cell immediately
above your first blank cell, then do CTRL-Enter. The formula will
appear in each of the blank cells, and you can fix the values if you
wish.

Hope this helps.

Pete
 

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