Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
if this than that macro
I need a macro that will find and place (similar to an if statement)
ex: =if 1 = 1, "1" , if 1 = 2," 2","3" however, i also need to say if 1 does not equal 1 or 2 etc then 0 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
if this than that macro
Do you mean
If Range("A1").Value = 1 Or Range("A1").Value = 2 Then Range("B1").Value = Range("A1").Value Else Range("B1").Value = 0 End If -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "dchristo" wrote in message ... I need a macro that will find and place (similar to an if statement) ex: =if 1 = 1, "1" , if 1 = 2," 2","3" however, i also need to say if 1 does not equal 1 or 2 etc then 0 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
if this than that macro
In column C
if there is an A, i want to replace with 1 if there is a B, I want to replace with 2 if there is an C, i want to replace with 3 if there is a D, I want to replace with 4 Any other letter, i want to replace with 0 "Bob Phillips" wrote: Do you mean If Range("A1").Value = 1 Or Range("A1").Value = 2 Then Range("B1").Value = Range("A1").Value Else Range("B1").Value = 0 End If -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "dchristo" wrote in message ... I need a macro that will find and place (similar to an if statement) ex: =if 1 = 1, "1" , if 1 = 2," 2","3" however, i also need to say if 1 does not equal 1 or 2 etc then 0 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
if this than that macro
You could use a case select property:
Select case letterx case A cell.value = 1 (not sure if that is right, but you get the idea) etc end select regards, mike "dchristo" wrote: In column C if there is an A, i want to replace with 1 if there is a B, I want to replace with 2 if there is an C, i want to replace with 3 if there is a D, I want to replace with 4 Any other letter, i want to replace with 0 "Bob Phillips" wrote: Do you mean If Range("A1").Value = 1 Or Range("A1").Value = 2 Then Range("B1").Value = Range("A1").Value Else Range("B1").Value = 0 End If -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "dchristo" wrote in message ... I need a macro that will find and place (similar to an if statement) ex: =if 1 = 1, "1" , if 1 = 2," 2","3" however, i also need to say if 1 does not equal 1 or 2 etc then 0 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
if this than that macro
does not work for what I am trying to do
"mike" wrote: You could use a case select property: Select case letterx case A cell.value = 1 (not sure if that is right, but you get the idea) etc end select regards, mike "dchristo" wrote: In column C if there is an A, i want to replace with 1 if there is a B, I want to replace with 2 if there is an C, i want to replace with 3 if there is a D, I want to replace with 4 Any other letter, i want to replace with 0 "Bob Phillips" wrote: Do you mean If Range("A1").Value = 1 Or Range("A1").Value = 2 Then Range("B1").Value = Range("A1").Value Else Range("B1").Value = 0 End If -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "dchristo" wrote in message ... I need a macro that will find and place (similar to an if statement) ex: =if 1 = 1, "1" , if 1 = 2," 2","3" however, i also need to say if 1 does not equal 1 or 2 etc then 0 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro recorded... tabs & file names changed, macro hangs | Excel Worksheet Functions | |||
AutoRun Macro with a delay to give user the choice to cancel the macro | Excel Programming | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
how to count/sum by function/macro to get the number of record to do copy/paste in macro | Excel Programming | |||
Start Macro / Stop Macro / Restart Macro | Excel Programming |