View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
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