Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default TOM it did not work...

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) Then
res = Application.Match(CLng(sStart), Range("A1:A30"), 0)

res1 = 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


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default TOM it did not work...

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

--
Regards,
Tom Ogilvy

"darno " wrote in message
...
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) Then
res = Application.Match(CLng(sStart), Range("A1:A30"), 0)

res1 = 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


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default TOM it did not work...

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


---
Message posted from http://www.ExcelForum.com/

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to update a column in a work based on another work sheet WickerMan New Users to Excel 1 December 4th 09 12:58 PM
how can i automatically generate work order numbers from work orde rob h Excel Discussion (Misc queries) 1 July 13th 09 07:59 PM
flash object dont work in my excel work sheet Nitn Excel Discussion (Misc queries) 0 July 4th 09 08:00 AM
Counting dates in multiple work sheets and work books Savage Excel Discussion (Misc queries) 0 December 19th 05 11:41 PM
Is there away to keep "auto save" from jumping to the first work sheet in the work book? Marc New Users to Excel 2 April 21st 05 01:27 AM


All times are GMT +1. The time now is 02:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"