Private Sub Commandbutton1_Click()
Dim bk as Workbook
set bk = Workbooks.Open("C:\DIR2\file2.xls")
bk.worksheets(1).Range("A1:A7").Copy
me.Range("A1:A7").PasteSpecial xlValues
bk.close SaveChanges:=False
End Sub
--
Regards,
Tom Ogilvy
"Mally" <(E-Mail Removed)> wrote in message
news:B6D37746-1E19-4AD5-9ED2-(E-Mail Removed)...
> Hi all.
>
> What I need is fairly simple, i think? I've put it into an example below.
>
> I have two files e.g. C:\DIR1\file1.xls and C:\DIR2\file2.xls.
>
> When i press a command button in file1 I want it to import the data from
> cells A1:A7 in file2 and copy the DATA VALUES ONLY into cells A1:A7 in
file1.
>
> I have searched through other questions that have been posted on this page
> but nothing really helps me.
>
> Any help most appriciated.
>
> Mally
|