Pinaceous
Well-known Member
- Joined
- Jun 11, 2014
- Messages
- 1,124
- Office Version
- 365
- Platform
- Windows
Hi all,
I'm working with the following sub and am wondering if there is a way to extend this range to include its column?
Please help with your posted suggestions & thank you!
For example, when I do this:
in lieu of:
it pops me with an error.
Please help me to extend the range of this sub.
Thank you!
pinaceous
I'm working with the following sub and am wondering if there is a way to extend this range to include its column?
Please help with your posted suggestions & thank you!
Code:
Sub BTWDates()
Dim x As Date
Dim sDate1 As Date
Dim sDate2 As Date
sDate1 = #10/1/2019#
sDate2 = #9/30/2020#
x = ActiveSheet.Range("B8:B66")
Select Case x
Case sDate1 To sDate2
MsgBox "Within Date Range"
Application.Cursor = xlDefault 'on completion / error
Case Else
MsgBox "Out of Date Specified Range"
End Select
End Sub
For example, when I do this:
Code:
x = ActiveSheet.Range("B8:B66")
in lieu of:
Code:
x = ActiveSheet.Range("B8")
it pops me with an error.
Please help me to extend the range of this sub.
Thank you!
pinaceous