ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Label colomn with the headers (https://www.excelbanter.com/excel-worksheet-functions/214972-label-colomn-headers.html)

myshak

Label colomn with the headers
 
I have big like following

Cables and Cords
R9858 Round Gray Cable
HH942 Optical Drive Serial ATA
NJ889 Thermal Sensor Cable
MK154 Cable Assembly for

Ribbon
X9259 Ribbon Cable for DIAG
FH439 Cable Assembly for Flex-Bay
5120P Power Cord, 6FT,
5R598 Power Cord, 6FT,
MK524 Hard Drive Serial



there is a big file with different headings


I need to delete the heading(cables and cords, Ribbon many more) and
put in the same row next to each record like following

R9858 Round Gray Cable Cables and Cords
HH942 Optical Drive Serial ATA Cables and Cords
NJ889 Thermal Sensor Cable Cables and Cords
MK154 Cable Assembly for Cables and Cords
X9259 Ribbon Cable for DIAG Ribbon
FH439 Cable Assembly for Flex-Bay Ribbon
5120P Power Cord, 6FT, Ribbon
5R598 Power Cord, 6FT, Ribbon
MK524 Hard Drive Serial Ribbon

Any macro for it?

thanks in advance

Spiky

Label colomn with the headers
 
If your setup is just like you showed, you can do it with a formula
pretty fast.

In C1:
=IF(A1="","",IF(B1="",A1,INDIRECT("C"&ROW()-1)))

Copy down all the way to the end. Then copy C column and Paste Values.
You can get rid of the extra lines fastest by doing a Sort on the B
column. It should group all the old "header" rows and you can delete
them quickly.

myshak

Label colomn with the headers
 
Thanks alot.

I really appreciate your time and effort into my question.



On Dec 30, 1:59*pm, Spiky wrote:
If your setup is just like you showed, you can do it with a formula
pretty fast.

In C1:
=IF(A1="","",IF(B1="",A1,INDIRECT("C"&ROW()-1)))

Copy down all the way to the end. Then copy C column and Paste Values.
You can get rid of the extra lines fastest by doing a Sort on the B
column. It should group all the old "header" rows and you can delete
them quickly.



Spiky

Label colomn with the headers
 
Glad to be of help.


All times are GMT +1. The time now is 01:14 AM.

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