Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey guys I am trying to develop a macro that will search for specific
column header names in an opened workbook, if the header is found I will get the data from the column data under the header and paste in into another column in another Workbook without specifying formating. Any help for that would be great. Thank you minkokiss |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I did not test this, so you should before using in the original workbook.
Sub FindCopyPaste() myHdr = Cells(1, Columns.Count).End(xlToLeft).Column myRng = Range(Cells(1, 1), Cells(1, myHdr)) With myRng Set c = .Find("HeaderName", After:=myHdr, Lookin:=xlValues) If Not c Is Nothing Then xRng = c.Address Range(xRng).Offset(1, 0).EntireColumn.Copy Workbooks("DifferentOne").Sheets("Whatever").Range ("$A$1") End If End With End Sub "minkokiss" wrote: Hey guys I am trying to develop a macro that will search for specific column header names in an opened workbook, if the header is found I will get the data from the column data under the header and paste in into another column in another Workbook without specifying formating. Any help for that would be great. Thank you minkokiss |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is actually one line in code:
Range(xRng).Offset(1, 0).EntireColumn.Copy Workbooks("DifferentOne").Sheets("Whatever").Range ("$A$1") There is a space between Copy and Workbooks. "minkokiss" wrote: Hey guys I am trying to develop a macro that will search for specific column header names in an opened workbook, if the header is found I will get the data from the column data under the header and paste in into another column in another Workbook without specifying formating. Any help for that would be great. Thank you minkokiss |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
column data retrieved based on value in header row | Excel Discussion (Misc queries) | |||
Copy data from other worksheet based on column header | Excel Discussion (Misc queries) | |||
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look | Excel Programming | |||
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look | Excel Discussion (Misc queries) | |||
How do I move data based on a conditional column search? | Excel Programming |