View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel[_668_] joel[_668_] is offline
external usenet poster
 
Posts: 1
Default Transfering Data From One Workbook to Another.


I won't write the entire solution. Ihave poste code like this plenty of
time but will explain the process


Set SourceSht = workbooks("book1.xls")
Set DestSht = workbooks("book2.xls")


with Sourcesht
for colcount = 1 to 5
HeaderName = .Cells(1,ColCount)

with DestSht

set c = .rows(1).find)what:=HeaderName, _
lookin:=xlvalues,lookat:xlwhole)
if c is nothing then
msgbox("Cannot find Header : " & HeaderName)
else
'c.column is the matching column in the destination sheet
end if
end with
next colcount
end with


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=179210

Microsoft Office Help