ItalianPlatinum
Well-known Member
- Joined
- Mar 23, 2017
- Messages
- 793
- Office Version
- 365
- 2019
- Platform
- Windows
Hello - looking for a way to expand my loop to also run off another loop. What I mean is it runs for all Items for each date. Currently I have it loop for all dates as seen below and want to add items. For example:
Dates and Items would like to be amendable based off another range in another sheet.
Date 5/5/21; run for Item A, B, C then
Date 5/6/21: run for Item A, B, C and so forth
Dates and Items would like to be amendable based off another range in another sheet.
Date 5/5/21; run for Item A, B, C then
Date 5/6/21: run for Item A, B, C and so forth
VBA Code:
Option Explicit
Sub RUN_DATE_LOOP()
Dim Dates As Date
Dim i As Long
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.EnableEvents = False
Call Clear
Sheets("Sec").Range("Items") = A
' Run Dates loop
i = 1
Do Until Sheets("Date Loop").Range("Dates").Offset(i, 0) = ""
Dates = Sheets("Date Loop").Range("Dates").Offset(i, 0)
Sheets("Sec").Range(REQDATE") = Dates
Call Sec2
i = i + 1
Loop
Application.ScreenUpdating = True
Application.DisplayAlerts = True
Application.EnableEvents = True
End Sub