Thread: Import to excel
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Import to excel

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


--
Gary''s Student - gsnu200804


"LtWmChance" wrote:

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