Back to Browse

List All Dates Between Two Dates in Excel | One VBA Macro Method and Two Formula Methods

19.0K views
Nov 18, 2022
8:17

📽️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_button_id=CGKRY2BAYEQBQ Thank you! 👍👍 Download the featured file and VBA code here: https://www.bluepecantraining.com/wp-content/uploads/2022/10/Dates-Between-Two-Dates.zip 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

Download

0 formats

No download links available.

List All Dates Between Two Dates in Excel | One VBA Macro Method and Two Formula Methods | NatokHD