View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Search for a column based on the column header and then past data

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