LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default find works very oddly

Hi folks,

following code works somtimes, sometimes it doesn't:

Dim foundRange As Range, dateRange As Range
Dim cellAddr As String, dateVal As Date, workingDay As String

workingDay = "02.05.07"
Set dateRange = ThisWorkbook.Worksheets("Mai").Range("D5:D36")
With dateRange
Set foundRange = .Find(what:=format(workingDay, "d") , _
LookIn:=xlValues, _
searchorder:=xlColumns,
_
SearchDirection:=xlNext,
_
LookAt:=xlPart)
Do
If foundRange Is Nothing Then Exit Do ' emergency exit
dateVal = foundRange.Value
Set foundRange = .FindNext(foundRange)
Loop Until dateVal = workingDay ' go 4it until found
End With ' search within a range

Any ideas ??

Thanx for help

chfa

 
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
ActiveX Control Text Rendering Oddly frankcatvertek Excel Discussion (Misc queries) 0 September 20th 10 06:54 PM
Works spreadsheet-find circular ref. dino Excel Worksheet Functions 1 October 22nd 07 05:52 PM
Select Case Behaving Oddly Kris_Wright_77 Excel Programming 3 June 6th 06 07:06 PM
OFFSET behaving oddly Ryan Poth Excel Worksheet Functions 2 May 30th 06 07:29 AM
=ISODD Behaving Oddly Craig[_15_] Excel Programming 5 April 30th 04 08:59 PM


All times are GMT +1. The time now is 07:46 AM.

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"