Solved

Code Modification

Posted on 2014-11-08
6
115 Views
Last Modified: 2014-11-10
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
0
Comment
Question by:itjockey
  • 2
  • 2
  • 2
6 Comments
 
LVL 39

Expert Comment

by:als315
ID: 40430950
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

0
 
LVL 29

Expert Comment

by:gowflow
ID: 40431291
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
0
 
LVL 8

Author Comment

by:itjockey
ID: 40432110
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
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 39

Accepted Solution

by:
als315 earned 250 total points
ID: 40432171
I've tested and it is working
NSE-Eq.xlsm
0
 
LVL 29

Assisted Solution

by:gowflow
gowflow earned 250 total points
ID: 40432175
Well then this should do it.
gowflow
NSE-Eq-V01.xlsm
0
 
LVL 8

Author Closing Comment

by:itjockey
ID: 40433453
Awesome
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question