Copy from CSV to Workbook sheet1

Luke777

Board Regular
Joined
Aug 10, 2020
Messages
246
Office Version
  1. 365
Platform
  1. Windows
Hi,

I've written code to select a CSV file an open it. All I want to do now is copy the entirety of the only sheet in the CSV (I've set the CSV to wb2, is that an issue?) to wb1.Sheet1.Range("A1").

I've got far enough to have the files open side by side, but I've tried a few copy paste methods that don't seem to be working. Is this something to do with my syntax or is there something fundamentally different about CSV to XLSM copy and pastes?

Thanks
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Have you thought about using Power Query to get the CSV file into your Excel sheet? That should make it a little less complicated.
 
Upvote 0
Have you thought about using Power Query to get the CSV file into your Excel sheet? That should make it a little less complicated.
I have - is it possible to get the file to import as not a table (just means i have to convert to range and remove headers)? I just want the data... I've got code already doing a lot of manipulating once its arrived (deleting unnecessary data, data validation etc)
 
Upvote 0
you can have it load as a table, and then use Excel functions to get the tables without the headers and it will spill the data.
 
Upvote 0
you can have it load as a table, and then use Excel functions to get the tables without the headers and it will spill the data.
I don't really understand why that would be simpler than opening the CSV and copy pasting the data, especially as I'm specifying the file through VBA using Application.FileDialog(msoFileDialogFilePicker)
 
Upvote 0
Because you have to open the file and manually copy and paste which causes room for error. Power Query will get exactly what you need in a click of a button
 
Upvote 0

Forum statistics

Threads
1,215,093
Messages
6,123,068
Members
449,091
Latest member
remmuS24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top