Import to excel

L

LtWmChance

I often have to import data into excel. This in itself is not the problem.
My source document does not provide the date and name on each line. These
items only appear on the first line. I need them on every line to sort
properly. The file is very large so cut and paste is out of the question.
So is dragging.

Than you,
Bill Chance
 
G

Gary''s Student

Select the cells you want to process and run the following macro. It will
take the date and name from the first cell and place it in front of the
others:

Sub fixup()
k = 0
For Each cell In Selection
If k = 0 Then
v = cell.Value
k = 1
Else
cell.Value = v & cell.Value
End If
Next
End Sub

For example, if the input data looks like:

9/15/2008 James
Larry
Moe
Curley


the macro will produce:

9/15/2008 James
9/15/2008 JamesLarry
9/15/2008 JamesMoe
9/15/2008 JamesCurley
 
G

Gord Dibben

Hard to tell with the lack of deatil but maybe.............?

Select the column(s) with the missing data then F5>Special>Blanks>OK

In the active cell enter an = sign then point or arrow to cell above then
CTRL + ENTER.

Edit>Copy

Edit>Paste Special>Values>OK>Esc


Gord Dibben MS 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