ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Import to excel (https://www.excelbanter.com/excel-discussion-misc-queries/202523-import-excel.html)

LtWmChance

Import to excel
 
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

Gary''s Student

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


Gord Dibben

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

Select the column(s) with the missing data then F5SpecialBlanksOK

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

EditCopy

EditPaste SpecialValuesOKEsc


Gord Dibben MS Excel MVP

On Mon, 15 Sep 2008 04:08:01 -0700, 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




All times are GMT +1. The time now is 11:17 AM.

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