Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default without using a loop...

is it possible to write a script that when a user enters a value, that checks
to see if the value is greater than the maximum value of a row?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default without using a loop...

Where Row 4 contains your data that you want to check against.
in A6 put this formula =IF(MAX(4:4)<B6,"Too big", "OK")
in B6 enter a new value.

Take a look at Data|Validation; that might work for you also.

--
Regards,
John


"Damon "Dutch" Kash" wrote:

is it possible to write a script that when a user enters a value, that checks
to see if the value is greater than the maximum value of a row?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default without using a loop...

John - this would be great for a formula solution, I was hoping to do this in
VBA script. Thanks, though. Anybody out there have a non-loop VBA answer?

"John Keith" wrote:

Where Row 4 contains your data that you want to check against.
in A6 put this formula =IF(MAX(4:4)<B6,"Too big", "OK")
in B6 enter a new value.

Take a look at Data|Validation; that might work for you also.

--
Regards,
John


"Damon "Dutch" Kash" wrote:

is it possible to write a script that when a user enters a value, that checks
to see if the value is greater than the maximum value of a row?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default without using a loop...

Damon,

Enter this code into the worksheet module (in XL, right-click the sheet tab
and choose "View Code". This assumes that the user entry is in cell A1 and
that the row to check against is Row 2:

Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Target, Range("A1")) Is Nothing Then
With Rows(2)
If Target.Value WorksheetFunction.Max(.EntireRow) Then
MsgBox "entry is bigger than anything in row 2"
End If
End With
End If

End Sub

hth,

Doug

"Damon "Dutch" Kash" <Damon "Dutch" wrote in
message ...
is it possible to write a script that when a user enters a value, that
checks
to see if the value is greater than the maximum value of a row?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default without using a loop...

As John said, Data Validation will do it.

If the DV cell and the MAX being checked are in different rows, use DV with
a type Custom and a formula of

=B6<=MAX(4:4)

If in the the same row, use a formula of

=B4<=LARGE(4:4,2)

The different formulae are because in the same row, the cell in question
could be the largest

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"Damon Dutch Kash" wrote in
message ...
John - this would be great for a formula solution, I was hoping to do this

in
VBA script. Thanks, though. Anybody out there have a non-loop VBA

answer?

"John Keith" wrote:

Where Row 4 contains your data that you want to check against.
in A6 put this formula =IF(MAX(4:4)<B6,"Too big", "OK")
in B6 enter a new value.

Take a look at Data|Validation; that might work for you also.

--
Regards,
John


"Damon "Dutch" Kash" wrote:

is it possible to write a script that when a user enters a value, that

checks
to see if the value is greater than the maximum value of a row?





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default without using a loop...

Bob,

It took me a bit to realize why the Large worked whether or not the cell in
question is the largest. Very nice.

Doug

"Bob Phillips" wrote in message
...
As John said, Data Validation will do it.

If the DV cell and the MAX being checked are in different rows, use DV
with
a type Custom and a formula of

=B6<=MAX(4:4)

If in the the same row, use a formula of

=B4<=LARGE(4:4,2)

The different formulae are because in the same row, the cell in question
could be the largest

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"Damon Dutch Kash" wrote in
message ...
John - this would be great for a formula solution, I was hoping to do
this

in
VBA script. Thanks, though. Anybody out there have a non-loop VBA

answer?

"John Keith" wrote:

Where Row 4 contains your data that you want to check against.
in A6 put this formula =IF(MAX(4:4)<B6,"Too big", "OK")
in B6 enter a new value.

Take a look at Data|Validation; that might work for you also.

--
Regards,
John


"Damon "Dutch" Kash" wrote:

is it possible to write a script that when a user enters a value,
that

checks
to see if the value is greater than the maximum value of a row?





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default without using a loop...

I went through the same thoughts when I came up with it Doug. I managed to
do it in my mind, but when I tried explaining it in words, even to myself, I
didn't convince myself <vbg

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"Doug Glancy" wrote in message
...
Bob,

It took me a bit to realize why the Large worked whether or not the cell

in
question is the largest. Very nice.

Doug

"Bob Phillips" wrote in message
...
As John said, Data Validation will do it.

If the DV cell and the MAX being checked are in different rows, use DV
with
a type Custom and a formula of

=B6<=MAX(4:4)

If in the the same row, use a formula of

=B4<=LARGE(4:4,2)

The different formulae are because in the same row, the cell in question
could be the largest

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"Damon Dutch Kash" wrote in
message ...
John - this would be great for a formula solution, I was hoping to do
this

in
VBA script. Thanks, though. Anybody out there have a non-loop VBA

answer?

"John Keith" wrote:

Where Row 4 contains your data that you want to check against.
in A6 put this formula =IF(MAX(4:4)<B6,"Too big", "OK")
in B6 enter a new value.

Take a look at Data|Validation; that might work for you also.

--
Regards,
John


"Damon "Dutch" Kash" wrote:

is it possible to write a script that when a user enters a value,
that

checks
to see if the value is greater than the maximum value of a row?







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
Loop inside a Loop jhahes[_52_] Excel Programming 6 April 7th 06 07:23 PM
Advancing outer Loop Based on criteria of inner loop ExcelMonkey Excel Programming 1 August 15th 05 05:23 PM
Loop Function unable to loop Junior728 Excel Programming 1 July 28th 05 10:23 AM
Problem adding charts using Do-Loop Until loop Chris Bromley[_2_] Excel Programming 2 May 23rd 05 01:31 PM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM


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