Link to home
Start Free TrialLog in
Avatar of Naresh Patel
Naresh PatelFlag for India

asked on

Code Modification

Hi Experts,

I just need to change some in my existing code. this code download zip files from one site from start date to end date mention on excel cells. but it only for current year only if I have to download for past years ...it cant I have to change year in code
With oFso
        If Not .FolderExists(strSavePath) Then
            MakeMultiStepDirectory strSavePath
        End If
    End With

  iYear = 2014

    datLastDate = DateValue(strEndDate)      'DateSerial(iYear, 4, 9)
    datWorkDate = DateValue(strStartDate)    'DateSerial(iYear, 1, 1)

Open in new window

above is in module "mldownload"

need to change in code that download what ever start date and end date enter in cells i.e. any year and many year

see attached

Thanks
NSE-Eq.xlsm
Avatar of als315
als315
Flag of Russian Federation image

Try to add one line after
Do
        strMonth = UCase(Format(datWorkDate, "MMM"))  ' upper case name of the month, like JAN

Open in new window


       
 iYear = Year(datWorkDate) 'Current Year

Open in new window

Here it is

Please replace this line
iYear = 2014

By these
Do
    On Error Resume Next
    iYear = InputBox("Please Enter Year to Process", "Year Input", Year(Now))
Loop Until Err = 0 And iYear >= 1900

Open in new window


Workbook attached.
Gowflow
NSE-Eq-V01.xlsm
Avatar of Naresh Patel

ASKER

Mr.als315,

I tried but not working and I want loop to all dates between start date and end date.

Sir.Gowflow,

Attached WB working but it ask for year in message box ...need to download all files between start date (cell A1) to end date (cell B1) in one click (Button Download) .....current it ask for year. needed - say  start date is 1 jan 2013 & end date 20 apr 2014 then it will download all files between this dates irrespective of year i.e. no message box.

Thanks

Thanks
ASKER CERTIFIED SOLUTION
Avatar of als315
als315
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Awesome