Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default chaniging a date in a url!!


Hi Guys,

I have set-up a Macro that goes to a website to get a competitors rat
see below:

Sub getit()

myurl
"http://www.all-hotels.com/xbook/servlet/DisplayRates?show=&partner=8&hotl_id=421725&type=a book&filter=&splurgeUrl=/europe/united_kingdom/england/south_east/bracknell_e1.htm&*txtArrivalDate1=17-Apr-2006*&*txtDepartureDate1=18-Apr-2006*&locationID=450210&hotel_name=&lastLocation=B racknell&cboArrivalMonths=Apr-2006&cboArrivalDays=10&cboNights=03&number_of_adul ts1=2&number_of_children1=0&number_of_beds1=1"

Wit
ActiveWorkbook.Worksheets("Bush").QueryTables.Add( Connection:="URL;"
myurl, Destination:=Worksheets("Bush").Cells(1, 1))

.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True

End With

End Sub

As you can see by the bold type the URL contains a date!
Is ther any way I can amend this if a enter a date into a cell i
excel.

Your Help would be gratefully appreciated.

Regards

Kevin Gun

--
gunny197
-----------------------------------------------------------------------
gunny1979's Profile: http://www.excelforum.com/member.php...fo&userid=3293
View this thread: http://www.excelforum.com/showthread.php?threadid=52756

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default chaniging a date in a url!!

myurl =
"http://www.all-hotels.com/xbook/servlet/DisplayRates?show=&partner=8&hotl_id=421725&type=a book&filter=&splurgeUrl=/europe/united_kingdom/england/south_east/bracknell_e1.htm&*txtArrivalDate1=XXXX*&*txtDepart ureDate1=YYYY*&locationID=450210&hotel_name=&lastL ocation=Bracknell&cboArrivalMonths=ZZZZ&cboArrival Days=XYZ&cboNights=STU&number_of_adults1=2&number_ of_children1=0&number_of_beds1=1"
MyUrl = Replace(MyURL,"XXXX",format(Range("A1"),"dd-mmm-yyyy"))
MyUrl = Replace(MyURL,"YYYY",format(Range("A2"),"dd-mmm-yyyy"))
MyUrl = Replace(MyURL,"ZZZZ",format(Range("A1"),"mmm-yyyy"))
MyUrl = Replace(MyURL,"XYZ", some formula that figures out arrival days)
MyUrl = Replace(MyURL,"STU", some formula that figures out nights)

And so forth

--
Regards,
Tom Ogilvy


"gunny1979" wrote:


Hi Guys,

I have set-up a Macro that goes to a website to get a competitors rate
see below:

Sub getit()

myurl =
"http://www.all-hotels.com/xbook/servlet/DisplayRates?show=&partner=8&hotl_id=421725&type=a book&filter=&splurgeUrl=/europe/united_kingdom/england/south_east/bracknell_e1.htm&*txtArrivalDate1=17-Apr-2006*&*txtDepartureDate1=18-Apr-2006*&locationID=450210&hotel_name=&lastLocation=B racknell&cboArrivalMonths=Apr-2006&cboArrivalDays=10&cboNights=03&number_of_adul ts1=2&number_of_children1=0&number_of_beds1=1"

With
ActiveWorkbook.Worksheets("Bush").QueryTables.Add( Connection:="URL;" &
myurl, Destination:=Worksheets("Bush").Cells(1, 1))

.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True

End With

End Sub

As you can see by the bold type the URL contains a date!
Is ther any way I can amend this if a enter a date into a cell in
excel.

Your Help would be gratefully appreciated.

Regards

Kevin Gunn


--
gunny1979
------------------------------------------------------------------------
gunny1979's Profile: http://www.excelforum.com/member.php...o&userid=32932
View this thread: http://www.excelforum.com/showthread...hreadid=527568


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default chaniging a date in a url!!


Hi I tried both of these and it does not like it, its there any othe
way I can try?

--
gunny197
-----------------------------------------------------------------------
gunny1979's Profile: http://www.excelforum.com/member.php...fo&userid=3293
View this thread: http://www.excelforum.com/showthread.php?threadid=52756

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default chaniging a date in a url!!

There is no reason why it should not work if you did it properly. Feel free
to send me a copy of your workbook and I will have a look.

--
Don Guillett
SalesAid Software

"gunny1979" wrote
in message ...

Hi I tried both of these and it does not like it, its there any other
way I can try??


--
gunny1979
------------------------------------------------------------------------
gunny1979's Profile:
http://www.excelforum.com/member.php...o&userid=32932
View this thread: http://www.excelforum.com/showthread...hreadid=527568



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
Concatenate including a date so that the date appears as a date Zembu Excel Worksheet Functions 2 January 6th 10 06:09 PM
date in Cell to change colors if the date is beyond today's date Pete Elbert Excel Discussion (Misc queries) 2 June 6th 09 06:31 AM
Making a date go red, if date passes todays date. Jamie Excel Worksheet Functions 2 September 9th 08 02:14 PM
Report Date - Date Recv = Days Late, but how to rid completed date MS Questionnairess Excel Worksheet Functions 1 January 24th 07 11:05 PM
Date updates from worksheet to chart & changes date to a date series! Help!! Jayjg Charts and Charting in Excel 2 January 22nd 05 03:00 PM


All times are GMT +1. The time now is 05:08 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"