Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import a data using a command button
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Import a data using a command button
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" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
command button to move data | Excel Worksheet Functions | |||
Import Data, using a command line switch | Excel Discussion (Misc queries) | |||
Import data button issue | Excel Discussion (Misc queries) | |||
Command button on data-entry form | Excel Discussion (Misc queries) | |||
Command Button Code to copy data | Excel Programming |