TOM it did not work...

D

darno

i tried your code, but it says type mismatch i am marking that line with
three greater than sysmbols >>>.


Dim sStart As String, sEnd As String
Dim res As Variant, res1 As Variant
Dim rng As Range
sStart = InputBox("Enter Start Date")
sEnd = InputBox("Enter End Date")

If IsDate(sStart) And IsDate(sEnd) Thenres1 = Application.Match(CLng(sEnd), Range("A1:A30"), 0)
If Not IsError(res) And Not IsError(res1) Then
Set rng = Range(Range("A1:A20")(res), Range("A1:A365")(res1))
rng.Resize(, 6).BordersAround Weight:=xlMedium, ColorIndex:=3
End If
End If

Please come back soon
 
T

Tom Ogilvy

Couple of revisions and corrected a typo and it worked for me with actual
dates in A1:A365 starting with Jan 01, 2004.

Sub AAtester10()
Dim sStart As String, sEnd As String
Dim res As Variant, res1 As Variant
Dim rng As Range
sStart = InputBox("Enter Start Date")
sEnd = InputBox("Enter End Date")

If IsDate(sStart) And IsDate(sEnd) Then
res = Application.Match(CLng(CDate(sStart)), Range("A1:A365"), 0)
res1 = Application.Match(CLng(CDate(sEnd)), Range("A1:A365"), 0)
If Not IsError(res) And Not IsError(res1) Then
Set rng = Range(Range("A1:A365")(res), Range("A1:A365")(res1))
rng.Resize(, 6).BorderAround Weight:=xlMedium, ColorIndex:=3
End If
End If

End Sub
 
D

darno

DEAR TOM,

YOU MADE MY DAY AND I AM THANKFUL TO YOU FROM MY HEAD TO FOOT. YOU DID
IT. THANKS
MAY GOD KEEP YOU HEALTHY AND WISE ALWAYS.


BEST REGARDS,


DARNO
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top