Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
I am trying to open a CSV file and copy portions from it. I would like to open \\mypath\myfile.csv then copy B3:Y3 to my other file sheet1 B5:Y5. Could someone please help? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I recorded this macro
Workbooks.Open Filename:="Mypath\myfile.csv" Range("B3:Y3").Select Selection.Copy Windows("MyOtherFile").Activate Range("B5").Select ActiveSheet.Paste When I activate the code it works but when I copy it into another module I get Application-defined or Object-defined error . The only difference is that the 2 files are not in the same directory. "Thanks" wrote: Hello I am trying to open a CSV file and copy portions from it. I would like to open \\mypath\myfile.csv then copy B3:Y3 to my other file sheet1 B5:Y5. Could someone please help? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
1. start with your original workbook
2. turn on the recorder 3. Data Import External Data Import Data (tell the Wizard where the .csv file is and tell the Wizard to make a new sheet) 4. copy the desired data from the new sheet to the original sheet 5. turn off the recorder Using the Import Wizard means that you do not have to deal with two open workbooks, only two worksheets. -- Gary''s Student - gsnu200829 "Thanks" wrote: I recorded this macro Workbooks.Open Filename:="Mypath\myfile.csv" Range("B3:Y3").Select Selection.Copy Windows("MyOtherFile").Activate Range("B5").Select ActiveSheet.Paste When I activate the code it works but when I copy it into another module I get Application-defined or Object-defined error . The only difference is that the 2 files are not in the same directory. "Thanks" wrote: Hello I am trying to open a CSV file and copy portions from it. I would like to open \\mypath\myfile.csv then copy B3:Y3 to my other file sheet1 B5:Y5. Could someone please help? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy and paste versus copy and insert copied cells | New Users to Excel | |||
Copy/Paste how to avoid the copy of formula cells w/o calc values | Excel Discussion (Misc queries) | |||
copy formulas from a contiguous range to a safe place and copy them back later | Excel Programming | |||
EXCEL FILE a copy/a copy/a copy ....filename | New Users to Excel | |||
How copy format, font, color and border without copy/paste? | Excel Programming |