Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Find Method for finding the next value in a range GT certain value

Greetings! Does anyone know of an efficient method or function for finding
the next value in a range which is greater than a specified value? My macro
would first select the range, look for the first/next value in a range
greater than a specified value. My macro would process that value, and
continue by looking for the next value in the range greater than the
specidied value. May you have a most blessed day!

Sincerely,

Michael Fitzpatrick
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Find Method for finding the next value in a range GT certain value

Greetings! I had a few typos in this post. It should read:
"Does anyone know of an efficient method or function for finding
the first/next value in a range which is greater than a specified value? My
macro
would first select the range, look for the first/next value in that range
which is
greater than the specified value. My macro would process that value, and
continue by looking for the next value in the range greater than the
specified value. "
--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick


"MichaelDavid" wrote:

Greetings! Does anyone know of an efficient method or function for finding
the next value in a range which is greater than a specified value? My macro
would first select the range, look for the first/next value in a range
greater than a specified value. My macro would process that value, and
continue by looking for the next value in the range greater than the
specidied value. May you have a most blessed day!

Sincerely,

Michael Fitzpatrick

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Find Method for finding the next value in a range GT certain value

Something like that ?

Option Explicit

Sub test()

Dim Xcell
Dim Limit ' the value to compare with
Dim MyRange As Range 'the range to search through

Limit = 2
Set MyRange = Range("H2:H17")

For Each Xcell In MyRange
If Xcell.Value Limit Then
'do what you have to do with Xcell
'exemple :substract 2 to the value
'and modify the font
Xcell.Value = Xcell.Value - 2
Xcell.Font.Italic = True
Xcell.Font.Bold = True
Xcell.Font.Color = vbRed
End If
Next Xcell

set MyRange=Nothing

End Sub




"MichaelDavid" a écrit dans le
message de ...
Greetings! I had a few typos in this post. It should read:
"Does anyone know of an efficient method or function for finding
the first/next value in a range which is greater than a specified value?
My
macro
would first select the range, look for the first/next value in that range
which is
greater than the specified value. My macro would process that value, and
continue by looking for the next value in the range greater than the
specified value. "
--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick


"MichaelDavid" wrote:

Greetings! Does anyone know of an efficient method or function for
finding
the next value in a range which is greater than a specified value? My
macro
would first select the range, look for the first/next value in a range
greater than a specified value. My macro would process that value, and
continue by looking for the next value in the range greater than the
specidied value. May you have a most blessed day!

Sincerely,

Michael Fitzpatrick


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Find Method for finding the next value in a range GT certain v

Greetings Charabeuh!

Thanks for your suggestion. My actual code is:

Dim CellPrice As Range
Dim LstRowData As Long
Dim CurrentPrice As Double

With ActiveSheet
LstRowData = .Range("O2")
.Range("M8:M" & LstRowData).UnMerge
CurrentPrice = .Range("H4")

For Each CellPrice In .Range("M8:M" & LstRowData)
If CellPrice.Value 8# * CurrentPrice Then
CellPrice.Interior.Color = vbYellow
End If
Next
End With

But I was hoping to find something more efficient. I am a speed fanatic. May
you have a blessed day.
--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick


"Charabeuh" wrote:

Something like that ?

Option Explicit

Sub test()

Dim Xcell
Dim Limit ' the value to compare with
Dim MyRange As Range 'the range to search through

Limit = 2
Set MyRange = Range("H2:H17")

For Each Xcell In MyRange
If Xcell.Value Limit Then
'do what you have to do with Xcell
'exemple :substract 2 to the value
'and modify the font
Xcell.Value = Xcell.Value - 2
Xcell.Font.Italic = True
Xcell.Font.Bold = True
Xcell.Font.Color = vbRed
End If
Next Xcell

set MyRange=Nothing

End Sub




"MichaelDavid" a écrit dans le
message de ...
Greetings! I had a few typos in this post. It should read:
"Does anyone know of an efficient method or function for finding
the first/next value in a range which is greater than a specified value?
My
macro
would first select the range, look for the first/next value in that range
which is
greater than the specified value. My macro would process that value, and
continue by looking for the next value in the range greater than the
specified value. "
--
May you have a most blessed day!

Sincerely,

Michael Fitzpatrick


"MichaelDavid" wrote:

Greetings! Does anyone know of an efficient method or function for
finding
the next value in a range which is greater than a specified value? My
macro
would first select the range, look for the first/next value in a range
greater than a specified value. My macro would process that value, and
continue by looking for the next value in the range greater than the
specidied value. May you have a most blessed day!

Sincerely,

Michael Fitzpatrick



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
Set range with Find method jlclyde Excel Discussion (Misc queries) 1 December 3rd 08 05:44 PM
Using PivotSelect method to find the top of a range Geoff Excel Programming 0 July 12th 07 02:32 AM
Find method fails in hidden range Rick Hansen Excel Programming 2 April 6th 06 10:54 PM
Not finding value, range method failing davegb Excel Programming 9 March 6th 06 03:40 PM
Find method - finding multiple values nathan Excel Programming 6 August 23rd 05 10:13 PM


All times are GMT +1. The time now is 07:11 PM.

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

About Us

"It's about Microsoft Excel"