Excel/Updating data using macros
Expert: Aidan Heritage - 5/14/2008
QuestionHi Aidan,
I have limited experience with VBA in Excel(2002) but I have created a macro to copy data from a web based reporting system within my company. Each day this data is updated thus a new filename is created.
Example:
www.reports.com/reports/late_tasks.csv=0&DataType=Daily&DataDate=2008-05-13&dsname=dataLib.br4_2&_saveas=4.2_RCT_Task_List.csv+
You will notice the date of 2008-05-13 in this address, all I need to do is make my macro change this date to today's date using the same format. I'm absolutely at a loss. Any help would be greatly appreciated.
If I haven't quite explained myself correctly please don't hesitate to email me.
Thanks in advance
Craig
AnswerYou didn't tell me what the code you are using is, but I assume you have the file name in a string somehow - use the FORMAT function within VBA to handle this
Dim MyName as string
MyName="www.reports.com/reports/late_tasks.csv=0&DataType=Daily&DataDate=" & format(now(),"YYYY-MM-DD") & "&dsname=dataLib.br4_2&_saveas=4.2_RCT_Task_List.csv+"
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your
Excel question answered in this area then please ask an Excel question here