#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 336
Default Import

I'm guessing that you've recorded as a macro the steps of importing the .csv
file and have ended up with a macro step that hardwires the workbook name,
e.g.
..Name = "Book1"
You could change this line as follows to work for whatever workbook happens
to be active:
..Name = ActiveWorkbook.Name

Hope that helps.

"John Sutton" wrote:

My apologies if this is in the wrong spot, I could find no obvious
place for it.

Is it possible to import a .CSV file into an existing .XLS? I want to
bring the data into a spreadsheet inside a macro, but I don't want to
have to use the file name of the spreadsheet, only the name of the
..CSV file. That way, I can use the same macro no matter what the file
is named.

Another alternative, is there a way to get the name of the spreadsheet
within the VB code, then I could just interrogate the spreadsheet for
it's name, open the .CSV file and then do my copy/paste operation to
get the data where I want it.

John
KBS

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
Import XML aushknotes Excel Discussion (Misc queries) 0 April 7th 10 03:29 AM
import XML data...Is there a size limit on the import? MatthewG Excel Discussion (Misc queries) 0 February 10th 09 05:57 PM
How to Start Excel in Text Import Wizard for data import rlelvis Setting up and Configuration of Excel 0 July 10th 08 08:40 PM
Import xml MaryAlice Excel Worksheet Functions 0 July 26th 06 02:45 PM
I can import Access Tables. But, I can't import Access queries nickg420[_8_] Excel Programming 0 August 5th 04 07:46 PM


All times are GMT +1. The time now is 05:04 PM.

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"