ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   In Excel how to make Column Values to Column Headings (https://www.excelbanter.com/excel-programming/314451-excel-how-make-column-values-column-headings.html)

JP

In Excel how to make Column Values to Column Headings
 
I have a single Column in one Spreadsheet of a workbook, and the values have
to be Column headings in another spreadsheet in the same workbook. How can I
do this Programmatically? Any help is greatly appreciated.

Thanks.
J

Gord Dibben

In Excel how to make Column Values to Column Headings
 
ToolsMacro "Record New Macro"

Copy the range of cells(not more than 256) from source worksheet.

Switch to target worksheet and Paste SpecialTransposeOKEsc.

Stop recording.

Gord Dibben Excel MVP

On Fri, 22 Oct 2004 14:09:02 -0700, "JP" wrote:

I have a single Column in one Spreadsheet of a workbook, and the values have
to be Column headings in another spreadsheet in the same workbook. How can I
do this Programmatically? Any help is greatly appreciated.

Thanks.
J



Tom Ogilvy

In Excel how to make Column Values to Column Headings
 
with worksheets("sheet1")
set rng = .Range(.Cells(1,1),.Cells(1,1).End(xldown))
End with
if rng.count <= 256 then
rng.copy
worksheets("Sheet2").Cells(1,1).PasteSpecial paste:=xlPasteAll,
Transpose:=True
end If

--
Rgars,
Tom Ogilvy


"JP" wrote in message
...
I have a single Column in one Spreadsheet of a workbook, and the values

have
to be Column headings in another spreadsheet in the same workbook. How can

I
do this Programmatically? Any help is greatly appreciated.

Thanks.
J





All times are GMT +1. The time now is 07:05 AM.

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