Avatar of Naresh Patel
Naresh Patel
Flag 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
Microsoft ExcelMicrosoft OfficeOffice Suites-Other

Avatar of undefined
Last Comment
Naresh Patel

8/22/2022 - Mon
als315

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

gowflow

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
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
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
als315

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
gowflow

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Naresh Patel

ASKER
Awesome