Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Leonard
 
Posts: n/a
Default insert data from one excel file into another

Is there any way to insert data from one excel file into another without
doing copy and pasting? I need to automate the process of inserting data but
I cannot use copy-paste, because it puts data on a clipboard, and my Excel
VBA program runs in a multi-user environment. So if one instance of a program
is copying data into clipboard, and another instance is pasting it at the
same time, it will paste incorrect data.

Thank you

Leonard.

  #2   Report Post  
Huw
 
Posts: n/a
Default

You'll need both spreadsheets open, but try this;

Option Explicit

Sub MyMacro()
Dim MyVariable As String

Windows("File2.xls").Activate 'Use the window name to select the file
MyVariable = Range("A1") 'Use a variable to store the data from "A1".

Windows("File1.xls").Activate 'Select the second workbook.
Range("A1").Select 'Select cell "A1".
ActiveCell.Text = MyVariable 'Use .Text to copy the data.
End Sub


"Leonard" wrote:

Is there any way to insert data from one excel file into another without
doing copy and pasting? I need to automate the process of inserting data but
I cannot use copy-paste, because it puts data on a clipboard, and my Excel
VBA program runs in a multi-user environment. So if one instance of a program
is copying data into clipboard, and another instance is pasting it at the
same time, it will paste incorrect data.

Thank you

Leonard.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with data not getting plotted Scott Ehrlich Charts and Charting in Excel 1 January 23rd 05 05:15 PM
Challenging Charting C TO Charts and Charting in Excel 0 January 17th 05 06:57 PM
Charting Data from Excel DavidM Charts and Charting in Excel 4 December 30th 04 02:31 PM
multiple or changing colours in a data table on an excel chart fo. Kerri Buxton Charts and Charting in Excel 2 December 23rd 04 07:39 PM
VBA Import of text file & Array parsing of that data Dennis Excel Discussion (Misc queries) 4 November 28th 04 10:20 PM


All times are GMT +1. The time now is 07:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"