ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   need to fill cells automatically (https://www.excelbanter.com/excel-worksheet-functions/13977-need-fill-cells-automatically.html)

Feltond

need to fill cells automatically
 
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?

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

--
Don Guillett
SalesAid Software

"Feltond" wrote in message
...
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?




Gord Dibben

Select column A and F5SpecialBlanksOK

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)VlauesOKEsc.


Gord Dibben Excel MVP

On Fri, 18 Feb 2005 14:01:03 -0800, "Feltond"
wrote:

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?




All times are GMT +1. The time now is 07:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com