Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have many colums of data on one worksheet. Each column has two header rows
that describe the data type (for example, "demand" and "production"). On a separate sheet, I would like to lookup and copy the data in all of the demand columns (and on another sheet, all of the production columns). It is easy enough to use hlookup to copy the value in a single cell, but how would I get the whole column? Thank you |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You could use a macro with code similar to the following:
Cells.Find(What:="demand", After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False, SearchFormat:=False).Activate columntouse = ActiveCell.Column Columns(columntouse).Select Selection.Copy Sheets("Sheet2").Select Columns(columntouse).Select ActiveSheet.Paste Hope this helps, -Chad "hello" wrote: I have many colums of data on one worksheet. Each column has two header rows that describe the data type (for example, "demand" and "production"). On a separate sheet, I would like to lookup and copy the data in all of the demand columns (and on another sheet, all of the production columns). It is easy enough to use hlookup to copy the value in a single cell, but how would I get the whole column? Thank you |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Chad -- Thank you for your reply. I was hoping I could get away with not
writing a macro, but if that's what I have to do, I'll give it a try. Is there a good reference for the macro code you used? Thanks again "Chad" wrote: You could use a macro with code similar to the following: Cells.Find(What:="demand", After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False, SearchFormat:=False).Activate columntouse = ActiveCell.Column Columns(columntouse).Select Selection.Copy Sheets("Sheet2").Select Columns(columntouse).Select ActiveSheet.Paste Hope this helps, -Chad "hello" wrote: I have many colums of data on one worksheet. Each column has two header rows that describe the data type (for example, "demand" and "production"). On a separate sheet, I would like to lookup and copy the data in all of the demand columns (and on another sheet, all of the production columns). It is easy enough to use hlookup to copy the value in a single cell, but how would I get the whole column? Thank you |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
lookup column label based on data in cell | Excel Worksheet Functions | |||
2 Column Data lookup | Excel Discussion (Misc queries) | |||
How to lookup a value from a ramge of data. Eg Column C Row D? | Excel Worksheet Functions | |||
How to lookup data in a row and column | Excel Discussion (Misc queries) | |||
How to lookup data in a row and column | Excel Worksheet Functions |