View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Art Art is offline
external usenet poster
 
Posts: 587
Default Enter the smallest amount in row

Its not bad, however, i want to change it, that if I have in A1 9, in B1 8,
and in c1 I enter 10, it should still stay 8 since there is a lower amount in
B1.

Thanks so much.

"Rick Rothstein" wrote:

Give this macro a try...

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Not Intersect(Target, Range("A1:H10")) Is Nothing Then
Range(Target, Cells(Target.Row, "H")).Value = Target.Value
End If
Application.EnableEvents = True
End Sub

To install the macro, right click the tab at the bottom of the worksheet
where you want this functionality, select View Code from the popup menu that
appears and copy/paste the above code into the code window that appears.
That's it... now go back to your worksheet and enter your values into the
range A1:H10.

--
Rick (MVP - Excel)


"art" wrote in message
...
Hello:

I would like to have a code that enters the smallest number on a row to
the
rest of the row. So lets say I use the range from A1 to H10. I want that
for
row 1 if it has in A1 the value 253 and in B1 the value 219 and in C1 the
value 198, so the rest of that row (until H1) should have the value 198.
And
when I'll enter the value 153 in D1, then all the rest after D1 should
update
to 153 and so on. This should occur in each row in the range.

I usually enter the amounts from left to right in the range.

Thanks for any help.

Art