List All Dates Between Two Dates in Excel | One VBA Macro Method and Two Formula Methods
Автор: Chester Tugwell
Загружено: 2022-11-18
Просмотров: 18305
Описание:
📽️So you want to get Excel to list all the dates between two dates. In this video I demonstrate three ways you can achieve this.
👍👍If you have found this content useful and want to show your appreciation, please use this link to buy me a beer 🍺.
https://www.paypal.com/donate/?hosted...
Thank you! 👍👍
Download the featured file and VBA code here: https://www.bluepecantraining.com/wp-...
Here' the code:
----------------------------------------------------------------------------------
Sub DateRange()
Dim startdate As Date
Dim enddate As Date
Dim outputcell As Range
Dim x As Integer
startdate = Application.InputBox(Prompt:="Select the cell containing your start date", _ Title:="Start Date", Type:=8)
enddate = Application.InputBox(Prompt:="Select the cell containing your end date", _ Title:="End Date", Type:=8)
Set outputcell = Application.InputBox(Prompt:="Select the cell you want to output dates to", _ Title:="Output", Type:=8)
For x = 0 To enddate - startdate
outputcell.Offset(x) = startdate + x
Next x
End Sub
----------------------------------------------------------------------------------
🕰️Timestamps
00:00 - Introduction
00:24 - Method 1: Using the SEQUENCE function (Excel 365 users)
02:38 - Method 2: Using the IF and ROW functions
04:57 - Method 3: Using a VBA macro
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: