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: 66
Default Finding a floating point value

I have a data file where one column has a section name and later I have a
column that is a rolling average of another column.

I have a routine that finds the range of that column based on section name
and assigns it to a variable, rngTarget. I've validated this part of the code
is selecting the correct range

Now, in a loop for each section, I do the following:

dblAveMinValue = Application.WorksheetFunction.Min(rngTarget)
Set rngTargetMinCell = rngTarget.Find( _
What:=dblAveMinValue, LookAt:=xlWhole, LookIn:= xlValues)
If Not rngTargetMinCell is Nothing Then
With rngTargetMinCell.Borders
.LineStyle = xlContinuous
.Weight = xlThick
End With
Else
MsgBox "Could Not find cell with value " & cstr(dblAveMinValue)
End If

There is always the right value in dblAveMinValue, but .Find can't find it.
I tried using varAveMinValue (Declared as Variant) but it makes no
difference. I realize there are issues with searching for Floating point
numbers, but I was hoping that searching for the value I just found would
work. :(

I'm wondering if how Excel stores the data in the worksheet is different
than how the value is represented as a double. Of course, I can pull the
range into a variant, iterate throught the range myself looking for the min
value, and save the index to translate it back to the sheet.

Is this the best way to accomplish this task?

Bob

 
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
Bitoperations with floating point numbers Parity[_3_] Excel Programming 2 April 7th 06 11:54 AM
Floating point number comparison Edward Ulle Excel Programming 4 March 27th 06 04:13 PM
Floating point problem?? Frederick Chow Excel Programming 6 January 3rd 06 03:39 AM
setting a floating decimel point Rose New Users to Excel 2 April 29th 05 06:10 PM
Floating Point Functions Joel Excel Programming 6 March 30th 05 10:29 PM


All times are GMT +1. The time now is 11:12 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"