Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Import a external data


I want to write a macro to import an external csv file into a sheet.
However when I use macro recorder to record the macro, the code
output only show a file name. My target is to ask user to choose
file
to import.
How can I write that macro

--
hurrianc
-----------------------------------------------------------------------
hurriance's Profile: http://www.excelforum.com/member.php...fo&userid=3088
View this thread: http://www.excelforum.com/showthread.php?threadid=55178

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Import a external data

Option Explicit
Sub testme()

Dim myFilename As Variant

myFilename = Application.GetOpenFilename _
(filefilter:="CSV Files, *.csv"))

if myFilename = false then
exit sub 'user hit cancel
end if

'stuff to import the file
end sub



hurriance wrote:

I want to write a macro to import an external csv file into a sheet.
However when I use macro recorder to record the macro, the code
output only show a file name. My target is to ask user to choose a
file
to import.
How can I write that macro?

--
hurriance
------------------------------------------------------------------------
hurriance's Profile: http://www.excelforum.com/member.php...o&userid=30882
View this thread: http://www.excelforum.com/showthread...hreadid=551783


--

Dave Peterson
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 external data nordiyu Excel Worksheet Functions 6 June 4th 10 09:49 AM
External Data Import MikeD1224 Excel Discussion (Misc queries) 1 February 16th 07 10:22 PM
import external data ana garcia Excel Discussion (Misc queries) 2 April 29th 06 04:05 AM
Import External Data - XML mklapp Excel Discussion (Misc queries) 0 October 26th 05 07:04 PM
Import External Data Jeff Excel Worksheet Functions 0 May 3rd 05 10:28 PM


All times are GMT +1. The time now is 08:18 PM.

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

About Us

"It's about Microsoft Excel"