Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Lee Lee is offline
external usenet poster
 
Posts: 33
Default Excel Test Formula

I know this should be simple but I can't make it work.

If cell (A1) is greater cell (A2), place result in (A2)

Thank You

Lee
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Excel Test Formula

I can only think of a worksheet change event.
right click on sheet tabview codeinsert thissave
will ONLY work for a change made in cell A2

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$A$2" Then Exit Sub
If Target.Offset(-1) Target Then Target.Offset (-1)
End Sub

"Lee" wrote in message
...
I know this should be simple but I can't make it work.

If cell (A1) is greater cell (A2), place result in (A2)

Thank You

Lee



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel Test Formula

This would require a circular formula in A2. This usually causes an error
(although you can allow it). I would suggest using a macro

Private Sub Worksheets_Calculate()
If range("A1").Value Range("A2").Value then
range("A2").Value = Range("A1").Value
End if
End Sub

Right click on the sheet tab and select view code. Paste in/write code
similar to the above.

--
Regards,
Tom Ogilvy

"Lee" wrote in message
...
I know this should be simple but I can't make it work.

If cell (A1) is greater cell (A2), place result in (A2)

Thank You

Lee



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Excel Test Formula

If Target.Offset(-1) Target Then Target.Offset (-1)

correct to
If Target.Offset(-1) Target Then target=Target.Offset (-1)

"Don Guillett" wrote in message
...
I can only think of a worksheet change event.
right click on sheet tabview codeinsert thissave
will ONLY work for a change made in cell A2

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address < "$A$2" Then Exit Sub
If Target.Offset(-1) Target Then Target.Offset (-1)
End Sub

"Lee" wrote in message
...
I know this should be simple but I can't make it work.

If cell (A1) is greater cell (A2), place result in (A2)

Thank You

Lee





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
Can you help test our Excel test? Jeff[_14_] Excel Discussion (Misc queries) 1 December 7th 09 05:11 PM
Excel formula to test a value BETWEEN 2 values? Romi Excel Discussion (Misc queries) 8 July 29th 09 11:19 PM
Calculate mean of test scores from rows of test answers RiotLoadTime Excel Discussion (Misc queries) 1 July 26th 06 05:14 PM
If formula to test several conditions MIchel Khennafi Excel Worksheet Functions 2 May 2nd 06 12:00 AM
test for a formula lashio Excel Discussion (Misc queries) 2 September 24th 05 04:10 AM


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