Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
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
![]() |
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help with data not getting plotted | Charts and Charting in Excel | |||
Challenging Charting | Charts and Charting in Excel | |||
Charting Data from Excel | Charts and Charting in Excel | |||
multiple or changing colours in a data table on an excel chart fo. | Charts and Charting in Excel | |||
VBA Import of text file & Array parsing of that data | Excel Discussion (Misc queries) |