You are here:

Excel/Updating data using macros

Advertisement


Question
Hi 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

Answer
You 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

All Answers

Answers by Expert:


Ask Experts

Volunteer


Aidan Heritage

Expertise

I have provided first hand support since `95 for Microsoft Office majoring in Word and Excel - support for all versions from 2 onwards

Experience

My background is in the insurance industry and call centre areas, but have been called upon to provide many varied solutions.

Education/Credentials
I'm educated to UK A level standard, but as I left school some 30 years ago that is rather irrelevent - university of life has provided more of a background!

©2009 About.com, a part of The New York Times Company. All rights reserved.