Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
creating list of column headers
Hi
I'm trying to create a list of column headers for an enormous spreadsheet, and I was wondering if there was an easy way to do this without cutting each header individually and pasting it into a single column. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
creating list of column headers
You could just select the row where all the headers are and Copy them.
Instead of paste, use EditPaste Special and then select Transpose. "rfhurley" wrote: Hi I'm trying to create a list of column headers for an enormous spreadsheet, and I was wondering if there was an easy way to do this without cutting each header individually and pasting it into a single column. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
creating list of column headers
Hi rfhurley,
rfhurley wrote: I'm trying to create a list of column headers for an enormous spreadsheet, and I was wondering if there was an easy way to do this without cutting each header individually and pasting it into a single column. I don't know if I understand exactly what you want to do. But here's some code that will take the first row (assuming those are your headers) and put them in a list in one column starting at A2 on the same sheet. This could be adapted easily to place the list on a different sheet if you want. Sub test() Dim nLastCol As Integer With ActiveSheet nLastCol = .Cells(1, .Columns.Count).End( _ xlToLeft).Column .Range(.Cells(1, 1), .Cells(1, nLastCol)).Copy .Range("A2").PasteSpecial Paste:=xlPasteValues, _ Transpose:=True End With End Sub -- Regards, Jake Marx www.longhead.com [please keep replies in the newsgroup - email address unmonitored] |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
creating list of column headers
Thank you, Mike. It worked like a charm.
Mike Jerakis wrote: You could just select the row where all the headers are and Copy them. Instead of paste, use EditPaste Special and then select Transpose. "rfhurley" wrote: Hi I'm trying to create a list of column headers for an enormous spreadsheet, and I was wondering if there was an easy way to do this without cutting each header individually and pasting it into a single column. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
creating a pick list from more than one column | Excel Discussion (Misc queries) | |||
Creating a dropdown list within a column | Excel Discussion (Misc queries) | |||
Excel column headers to a vertical list | Excel Discussion (Misc queries) | |||
Excel column headers to a vertical list | Excel Discussion (Misc queries) | |||
Multi-column list box with headers question... | Excel Programming |