So this macro. It's written not directly in VB, but coded using captured keystrokes?
- Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
- Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!
£12 Travelodge Sale
Collapse
X
-
-
It's in VB. It uses a Web Query to loop around the dates and returns the data into individual sheets before combining the data into a table & running a pivot. As I said cludgy.Originally posted by TimberWolf View PostSo this macro. It's written not directly in VB, but coded using captured keystrokes?What happens in General, stays in General.You know what they say about assumptions!Comment
-
Cool, haven't used Web Query before, or Excel for ages for that matter.Originally posted by MarillionFan View PostIt's in VB. It uses a Web Query to loop around the dates and returns the data into individual sheets before combining the data into a table & running a pivot. As I said cludgy.
Pull data into Microsoft Excel with Web queries | TechRepublicComment
-
Comment
-
His hotel room doesn't have wifi.Originally posted by TimberWolf View PostWhere is DimPrawn to tell us that one must spend at least £3000/week on hotels.If your company is the best place to work in, for a mere £500 p/d, you can advertise here.Comment
-
He's still got the breakfast dishes to wash.Originally posted by pmeswani View PostHis hotel room doesn't have wifi.Comment
-
I was going to combine in to one report but cannot be bothered. But basically this runs queries against the Travelodge site. Copy the code into a module in Excel and then run it.
I am fairly certain one of the web developers on here could do a pretty cool bookmarklet to do something much more sophisticated.
Code:Sub GetTravel() ' ' GetTravel Macro ' Dim Sheetname As String Dim Sheets(100) As String Dim icnt As Integer Dim Location As String Dim SearchDate As Date Dim StartDate As Date Dim EndDate As Date Dim GetStr As String ' Location = InputBox("Please type in a Travel Lodge Location") StartDate = InputBox("Please enter start date") EndDate = InputBox("Please enter end date") SearchDate = Now icnt = 0 For i = DateValue(StartDate) To DateValue(EndDate) Step 7 Worksheets.Add Sheetname = Format(i, "d") & "-" & Format(i, "mmm") & Format(i, "-yyyy") For j = 1 To Worksheets.Count If Worksheets(j).Name = Sheetname Then Application.DisplayAlerts = False Worksheets(Sheetname).Delete Application.DisplayAlerts = True Exit For End If Next j ActiveSheet.Name = Sheetname icnt = icnt + 1 Sheets(icnt) = Sheetname ' checkindate = Format(i, "d") & "%2F0" & Format(i, "mm") & "%2F" & Format(i, "yyyy") GetStr = "URL;http://www.travelodge.co.uk/search_and_book/saver_search.php?action=search&tab=list&source=XX&search_for=PROM3&checkInDate=" & checkindate & "&locpostText=" & Location ' getstr = "URL;http://www.travelodge.co.uk/search_and_book/saver_search.php?action=search&tab=list&source=XX&search_for=PROM3&checkInDate=" & Str(i) & "%2F0" & Format(j, "00") & "%2F2012&locpostText=somerset" ' With ActiveSheet.QueryTables.Add(Connection:= _ GetStr _ , Destination:=Range("$A$1")) .Name = "saver_search.php?action=search&tab=list&source=XX&search_for=PROM3&checkInDate=" & checkindate & "&locpostText=" & Location .FieldNames = True .RowNumbers = True .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .WebSelectionType = xlAllTables .WebFormatting = xlWebFormattingNone .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False End With Range("a1").Value = i Range("a1").NumberFormat = "dd/mmm/yyyy" ActiveCell.Offset(0, 2).Value = DateValue(Sheets(icnt)) - 3 ActiveCell.Offset(0, 3).Value = DateValue(Sheets(icnt)) - 2 ActiveCell.Offset(0, 4).Value = DateValue(Sheets(icnt)) - 1 ActiveCell.Offset(0, 5).Value = DateValue(Sheets(icnt)) - 0 ActiveCell.Offset(0, 6).Value = DateValue(Sheets(icnt)) + 1 ActiveCell.Offset(0, 7).Value = DateValue(Sheets(icnt)) + 2 ActiveCell.Offset(0, 8).Value = DateValue(Sheets(icnt)) + 3 Next End SubLast edited by MarillionFan; 16 April 2012, 19:54.What happens in General, stays in General.You know what they say about assumptions!Comment
-
Basically yes - it's a key logger that will log your CUK password, online banking access etc...Originally posted by TimberWolf View PostSo this macro. It's written not directly in VB, but coded using captured keystrokes?Comment
-
Ah, Russian humour must make dark cold winter nights fly byOriginally posted by AtW View PostBasically yes - it's a key logger that will log your CUK password, online banking access etc...
Comment
-
Worked for me. I've now only got 12 trial runs of MS Excel student edition left...Originally posted by MarillionFan View PostI was going to combine in to one report but cannot be bothered. But basically this runs queries against the Travelodge site. Copy the code into a module in Excel and then run it.
I am fairly certain one of the web developers on here could do a pretty cool bookmarklet to do something much more sophisticated.
Code:Sub GetTravel() ' ' GetTravel Macro ' Dim Sheetname As String Dim Sheets(100) As String Dim icnt As Integer Dim Location As String Dim SearchDate As Date Dim StartDate As Date Dim EndDate As Date Dim GetStr As String ' Location = InputBox("Please type in a Travel Lodge Location") StartDate = InputBox("Please enter start date") EndDate = InputBox("Please enter end date") SearchDate = Now icnt = 0 For i = DateValue(StartDate) To DateValue(EndDate) Step 7 Worksheets.Add Sheetname = Format(i, "d") & "-" & Format(i, "mmm") & Format(i, "-yyyy") For j = 1 To Worksheets.Count If Worksheets(j).Name = Sheetname Then Application.DisplayAlerts = False Worksheets(Sheetname).Delete Application.DisplayAlerts = True Exit For End If Next j ActiveSheet.Name = Sheetname icnt = icnt + 1 Sheets(icnt) = Sheetname ' checkindate = Format(i, "d") & "%2F0" & Format(i, "mm") & "%2F" & Format(i, "yyyy") GetStr = "URL;http://www.travelodge.co.uk/search_and_book/saver_search.php?action=search&tab=list&source=XX&search_for=PROM3&checkInDate=" & checkindate & "&locpostText=" & Location ' getstr = "URL;http://www.travelodge.co.uk/search_and_book/saver_search.php?action=search&tab=list&source=XX&search_for=PROM3&checkInDate=" & Str(i) & "%2F0" & Format(j, "00") & "%2F2012&locpostText=somerset" ' With ActiveSheet.QueryTables.Add(Connection:= _ GetStr _ , Destination:=Range("$A$1")) .Name = "saver_search.php?action=search&tab=list&source=XX&search_for=PROM3&checkInDate=" & checkindate & "&locpostText=" & Location .FieldNames = True .RowNumbers = True .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .WebSelectionType = xlAllTables .WebFormatting = xlWebFormattingNone .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False End With Range("a1").Value = i Range("a1").NumberFormat = "dd/mmm/yyyy" ActiveCell.Offset(0, 2).Value = DateValue(Sheets(icnt)) - 3 ActiveCell.Offset(0, 3).Value = DateValue(Sheets(icnt)) - 2 ActiveCell.Offset(0, 4).Value = DateValue(Sheets(icnt)) - 1 ActiveCell.Offset(0, 5).Value = DateValue(Sheets(icnt)) - 0 ActiveCell.Offset(0, 6).Value = DateValue(Sheets(icnt)) + 1 ActiveCell.Offset(0, 7).Value = DateValue(Sheets(icnt)) + 2 ActiveCell.Offset(0, 8).Value = DateValue(Sheets(icnt)) + 3 Next End SubComment
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- Umbrella, PEO/GPP, or salaried EOR. Which is up 153% in 2026? Aug 6 08:43
- Outside IR35 isn’t making a comeback in 2026/27 — it’s something more complex Aug 5 04:55
- Why contractors keep putting off their pension (and why I'm one of them) Aug 4 02:43
- HMRC loan charge settlement offer: 3 things to check before you sign Aug 3 07:41
- HMRC standstill agreements extended to 72 months: why the term's doubled, and what to check before signing Jul 31 05:53
- Who owns the loans? Inside the mystery of the loan charge recall scandal Jul 30 06:20
- Umbrella company winding-up petitions in 2026: the practical guide for contractors Jul 29 05:29
- Payments on Account deadline: what contractors must do before July 31st — maybe for the final few times Jul 28 08:01
- Andy Burnham's first 100 days: five things contractors need from the new PM Jul 27 00:53
- Starmer vs Burnham on housing: What their rival plans mean for your contractor mortgage Jul 22 00:59

Comment