use test value for 2 cells

P

PeCoNe

Hallo,

if i put a value in test, i want that value in pr or value in ow is
changed to value in test depending on which is closest.
How can i do that in a simple way?

pr ow test
2.88 12.87

bye Peter
 
C

Claus Busch

Hi Peter,

Am Thu, 12 Sep 2013 13:22:17 +0200 schrieb PeCoNe:
if i put a value in test, i want that value in pr or value in ow is
changed to value in test depending on which is closest.
How can i do that in a simple way?

pr ow test
2.88 12.87

try:
If Abs(Range("pr") - Range("test")) _
< Abs(Range("ow") - Range("test")) Then
Range("pr") = Range("test")
Else
Range("ow") = Range("test")
End If


Regards
Claus B.
 
P

PeCoNe

Op 2013-09-12 13:39, Claus Busch schreef:
Hi Peter,

Am Thu, 12 Sep 2013 13:22:17 +0200 schrieb PeCoNe:


try:
If Abs(Range("pr") - Range("test")) _
< Abs(Range("ow") - Range("test")) Then
Range("pr") = Range("test")
Else
Range("ow") = Range("test")
End If


Regards
Claus B.
Thanks Claus.
I tried that but than i get a circulair reference.
it is a normal excel and not in vba.

Bye Peter
 
P

PeCoNe

Op 2013-09-12 14:14, Claus Busch schreef:
Hi Peter,

Am Thu, 12 Sep 2013 14:09:37 +0200 schrieb PeCoNe:


you have to do it with VBA. In Excel you will always get a circular
reference.


Regards
Claus B.
ok i understand
thanks Claus.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top