nniedzielski
Well-known Member
- Joined
- Jan 8, 2016
- Messages
- 598
- Office Version
- 2019
- Platform
- Windows
I am running a macro that is going back 15 days scraping data, I need to know how to write code that will get my macro to stop after it has gone back 15 days, I was thinking of dooing a Do Until Loop, but i cant figure out how to write a Do Until that will stop after 15 days.
Here is what I have so far:
I only want this to be done for 15 days and then stop going to 64.
How can I achieve this?
thank you,
Here is what I have so far:
Code:
9
lDate = lDate - 1
lMonth = Format(lDate, "mm")
lDay = Format(lDate, "dd")
lYear = Format(lDate, "yy")
lweekday = Weekday(lDate, vbMonday)
GoTo 64
I only want this to be done for 15 days and then stop going to 64.
How can I achieve this?
thank you,