scottleger4
New Member
- Joined
- Oct 3, 2016
- Messages
- 41
- Office Version
- 365
- Platform
- Windows
Good morning! I'm trying to create a loop that operates with a specified date range and interacts with host explorer. I need it to advance the start date by one until it goes past the end date and then stop. Here was my first go at it, but stepping through eventually led to a "Run-time error '13': Type mismatch" at my "a = a + 1".
a = SDate
b = EDate
OnRent = OnRent1
Do Until a > b
Wait
RC = MyHost.keys(OnRent)
RC = MyHost.runcmd("TAB")
a = a + 1
Set OnRent = OnRent.Offset(0, 1)
Wait
WaitForReady
Loop
If SDate = 10/18/2018 (for example), how do I tell VBA to change SDate to be 10/19/2018 after running the two "RC" lines of code? Thanks in advance.
a = SDate
b = EDate
OnRent = OnRent1
Do Until a > b
Wait
RC = MyHost.keys(OnRent)
RC = MyHost.runcmd("TAB")
a = a + 1
Set OnRent = OnRent.Offset(0, 1)
Wait
WaitForReady
Loop
If SDate = 10/18/2018 (for example), how do I tell VBA to change SDate to be 10/19/2018 after running the two "RC" lines of code? Thanks in advance.