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 External Data Macro

Hi,

I'm trying to write a macro so I can view a web page via importing data in
Excel. Normally this isn't an issue for me as I can run the automated Macro
via Tools-Macro and then import the web page that I desire via Data-Import
external Data. However, the webpage that I want to import will actually
change each day.

Here is a ample:

ftp://ftp.nasdaqtrader.com/symboldir...th20051228.txt (Dec
28 2005 data)


Currently I can run the following macro and it will import the data:

With ActiveSheet.QueryTables.Add(Connection:= _

"URL;ftp://ftp.nasdaqtrader.com/symboldirectory/regsho/nasdaqth20051228.txt",
_
Destination:=Range("C6"))
.Name = "nasdaqth20051228"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With



However, the next day I will want to view a different page - instead of

ftp://ftp.nasdaqtrader.com/symboldir...th20051228.txt

(Dec 28, 2005 data)

I would want Dec 30th data:

ftp://ftp.nasdaqtrader.com/symboldir...th20051230.txt



Does anyone know of any easy way that I can write a macro so that the page
I'm requesting can change from day to day without having to go into the macro
and changing the day manually?? I have no experience with writing macros but
I can actually write something in Excel so that the desired webpage address
would appear in a particular cell (say A1)

TIA


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default Import External Data Macro

Hi

When defining your URL, why don't you use simple concatenation, with
the & operator ... such as & range("a1").value ...

HTH
Cheers
Carim

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 Swan0tree Excel Discussion (Misc queries) 2 October 1st 09 10:19 PM
Import External Data Willow Excel Discussion (Misc queries) 0 June 8th 07 12:27 PM
Import External Data WhytheQ Excel Discussion (Misc queries) 1 January 25th 07 05:51 PM
import external data Dave Excel Discussion (Misc queries) 0 May 24th 05 11:19 PM
import external data via macro/vba question Drabbacs Excel Programming 1 May 24th 04 11:36 PM


All times are GMT +1. The time now is 02:49 AM.

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"