need to fill cells automatically

F

Feltond

I've imported a data file into Excel that has a unique 'key' value in column
A and a list of associated values in Column B. The number of values in
column B will vary and the 'key' value in column A only appears once per set
of associated Column B values. I need to fill in the blank cells in column A
with the 'key' value so that each row will have a values in A and B.

This is too large a file to do manually with a manual fill-down each time a
new value in column A is encountered. Any suggestions or solutions?
 
D

Don Guillett

try this. modify to suit

Sub fillincolumn()
For Each c In Range("h1:h8")
If c = "" Then c.Value = c.Offset(-1)
Next
End Sub
 
G

Gord Dibben

Select column A and F5>Special>Blanks>OK

With the blanks selected type an = sign in activecell.

Point with cursor to cell above with 'key' and hit CTRL + ENTER.

The 'keys' will fill down.

Copy Column A and Paste Special(in place)>Vlaues>OK>Esc.


Gord Dibben Excel MVP
 

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