ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Append two rows from report (https://www.excelbanter.com/excel-discussion-misc-queries/190241-append-two-rows-report.html)

Bob Hopson

Append two rows from report
 
I would like a macro to do the following:
I have two rows to concatenate
The first row has columns A through G
The second row has columns B through G
I would like to append the second row to the end of the first row starting
in column H. If Col C ='PER' append second row starting in column H of first
row

The are 1450 records to do this for.

Thanks

joel

Append two rows from report
 
Is the PER in the 1st or second row?

which column can I use to find the last row of data (B or C)?

"Bob Hopson" wrote:

I would like a macro to do the following:
I have two rows to concatenate
The first row has columns A through G
The second row has columns B through G
I would like to append the second row to the end of the first row starting
in column H. If Col C ='PER' append second row starting in column H of first
row

The are 1450 records to do this for.

Thanks


ShaneDevenshire

Append two rows from report
 
Hi Bob,

you don't need a macro. In cell H1 (assume row 1 is the first row) enter the
formula =IF($C1="Per",B2,"").
Copy this formula to the right as far as necessary.
Highlight H1:M2 and use the fill handle to fill down as far as necessary.
Highlight all the formula cells, say H1:M1450 and choose Copy, then choose
Edit, Paste Special, Values.

--
Cheers,
Shane Devenshire
Microsoft Excel MVP

"Bob Hopson" wrote:

I would like a macro to do the following:
I have two rows to concatenate
The first row has columns A through G
The second row has columns B through G
I would like to append the second row to the end of the first row starting
in column H. If Col C ='PER' append second row starting in column H of first
row

The are 1450 records to do this for.

Thanks


Bob Hopson

Append two rows from report
 
Hi Joel,

In second row use column C

Thanks

Bob

"Joel" wrote:

Is the PER in the 1st or second row?

which column can I use to find the last row of data (B or C)?

"Bob Hopson" wrote:

I would like a macro to do the following:
I have two rows to concatenate
The first row has columns A through G
The second row has columns B through G
I would like to append the second row to the end of the first row starting
in column H. If Col C ='PER' append second row starting in column H of first
row

The are 1450 records to do this for.

Thanks


Bob Hopson

Append two rows from report
 
Thanks Shane. I'll try it and let you know how I make out.

Bob

"ShaneDevenshire" wrote:

Hi Bob,

you don't need a macro. In cell H1 (assume row 1 is the first row) enter the
formula =IF($C1="Per",B2,"").
Copy this formula to the right as far as necessary.
Highlight H1:M2 and use the fill handle to fill down as far as necessary.
Highlight all the formula cells, say H1:M1450 and choose Copy, then choose
Edit, Paste Special, Values.

--
Cheers,
Shane Devenshire
Microsoft Excel MVP

"Bob Hopson" wrote:

I would like a macro to do the following:
I have two rows to concatenate
The first row has columns A through G
The second row has columns B through G
I would like to append the second row to the end of the first row starting
in column H. If Col C ='PER' append second row starting in column H of first
row

The are 1450 records to do this for.

Thanks


Bob Hopson

Append two rows from report
 
Hi Shane,

I tried your suggestion, but I am getting the send row appended to itself.
Here is my data. I need Row 2 columns appended to Row 1 starting Col G. Is
there a way to cut Row 2 and append to Row 1 when $A1="PER"

Row 1 - Col A - Barbara M.;Col B, C E - blank; Col D - 649711; Col F - 100018
Row 2 - Col A - PER; Cols B,C,D,E, F whatever


BARBARA M. 6469711 100018
PER 0 0 0 0 0


Thanks

Bob

"ShaneDevenshire" wrote:

Hi Bob,

you don't need a macro. In cell H1 (assume row 1 is the first row) enter the
formula =IF($C1="Per",B2,"").
Copy this formula to the right as far as necessary.
Highlight H1:M2 and use the fill handle to fill down as far as necessary.
Highlight all the formula cells, say H1:M1450 and choose Copy, then choose
Edit, Paste Special, Values.

--
Cheers,
Shane Devenshire
Microsoft Excel MVP

"Bob Hopson" wrote:

I would like a macro to do the following:
I have two rows to concatenate
The first row has columns A through G
The second row has columns B through G
I would like to append the second row to the end of the first row starting
in column H. If Col C ='PER' append second row starting in column H of first
row

The are 1450 records to do this for.

Thanks



All times are GMT +1. The time now is 04:45 PM.

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