![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 6
|
I need to change the value of a cell if a criteria is met otherwise leave the current value of that cell intact - How do I do that?
|
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Apr 2002
Posts: 85
|
You could try some VB.
If Activecell.value = (your criteria) then activecell.value = (new value) else activecell.offsett(1,0).select 'go to next cell end if |
|
|
|
|
|
#3 |
|
New Member
Join Date: May 2002
Posts: 11
|
you can also use a formula for this.
=if(celllocation=criteria, newvalue,celllocation) substitute the cell address, criteria and newvalue for the names above. |
|
|
|
|
|
#4 |
|
New Member
Join Date: Apr 2002
Posts: 6
|
Phiore,
When I use your formula I get a 'circular reference' error. This is due to trying to leave the value of the 'test' cell when the 'criteria' is not met. Any other ideas PS. I am not a VB programer [ This Message was edited by: Puntarenas on 2002-05-02 16:19 ] |
|
|
|
|
|
#5 | |
|
Board Regular
Join Date: Feb 2002
Posts: 202
|
Quote:
|
|
|
|
|
|
|
#6 |
|
New Member
Join Date: Apr 2002
Posts: 6
|
Anno,
Sorry taken so long to reply (traveling). Basically, what I am trying to do is to leave the value of the cell being tested intact unless the value of another cell matches a criteria Ex. A2= 8 A5= Y I want to test cell A2 so that if A5 = Y change the value to 10 else leave 8. Does this help? JAC |
|
|
|
|
|
#7 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Board Regular
Join Date: Mar 2002
Location: Hellas
Posts: 553
|
Hello Jac
take a look, is this what you mean or am i missing something?
You can see the value of cells only click each above hyperlinks
__________________
Best Regards Andreas
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
#8 |
|
New Member
Join Date: Apr 2002
Posts: 6
|
Adrian,
Thank you for your response. You almost had it right. Using your example: For the value of A2: If A5 = 'Y' then place the value of '10' in A2 else place whatever the current value of A5 in A2. JAC [ This Message was edited by: Puntarenas on 2002-06-10 12:58 ] [ This Message was edited by: Puntarenas on 2002-06-10 12:59 ] [ This Message was edited by: puntarenas on 2002-07-11 17:01 ] |
|
|
|
|
|
#9 |
|
New Member
Join Date: Jan 2007
Posts: 3
|
This is my question also. I want to test the value of a cell. If it is void, empty, my If statement will be true and text will be entered. If it is false, ie there is text or numbers in the cell, (and there ussally will be), I want it left alone. Something like
a b c 1 2 45 $1 1 3 46 $2 2 IF(A1="","Page " &C2". do nothing |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|