Hi,
I need help, i want bot to ask for user inputs for start date and end date so based on the input provided by user i need to write the dates in sheet…below is the example
Input dailog box - Start date - 15/01/2022
Input dailog box - End date - 30/01/2022
So if the user input is like this then i want the output as below
15/01/2022
16/01/2022
17/01/2022
18/01/2022
…….
……
…
30/01/2022
Yoichi
(Yoichi)
January 23, 2022, 11:40am
2
Hi,
Hope the following sample helps you.
sDate = DateTime.ParseExact(sDateStr,"d/M/yyyy",System.Globalization.CultureInfo.InvariantCulture)
eDate = DateTime.ParseExact(eDateStr,"d/M/yyyy",System.Globalization.CultureInfo.InvariantCulture)
arrDate = Enumerable.Range(0,(eDate-sDate).Days+1).Select(Function(i) sDate.AddDays(i)).ToArray()
Sample20220123-1.zip (2.4 KB)
Regards,
Yoichi
(Yoichi)
January 23, 2022, 11:58am
3
Hi,
FYI, If you want to write the result to xlsx sheet, the following will be better.
dt = Enumerable.Range(0,(eDate-sDate).Days+1).Select(Function(i) dt.LoadDataRow({sDate.AddDays(i).ToString("dd/MM/yyyy")},False)).CopyToDataTable()
Sample20220123-1v2.zip (2.8 KB)
Regards,
WOW you are amazing Yoichi, Thank you so much
The solution is working super fine as I wanted…
1 Like
system
(system)
Closed
January 27, 2022, 4:48am
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.