Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
macro if statements
I'm trying to write a simple if statement that looks at an active cell and
compares is to the data in another cell. So far I have: If Selection.Value = ??????? Then Please help me fill in the ???????. This is probably very simple but I'm just learning. Thanks, |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
macro if statements
in the simplest form
if selection.value=range("a1") then msgbox "Hi" -- Don Guillett SalesAid Software "Donna S" <Donna wrote in message ... I'm trying to write a simple if statement that looks at an active cell and compares is to the data in another cell. So far I have: If Selection.Value = ??????? Then Please help me fill in the ???????. This is probably very simple but I'm just learning. Thanks, |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
macro if statements
This is one option:
If Selection.Value = ActiveSheet.Range("A1").Value Then It compares the value on the selected cell with the range A1 of the same worksheet. Hope this helps, Miguel. "Donna S" wrote: I'm trying to write a simple if statement that looks at an active cell and compares is to the data in another cell. So far I have: If Selection.Value = ??????? Then Please help me fill in the ???????. This is probably very simple but I'm just learning. Thanks, |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
macro if statements
If activecell.value = worksheets("sheet99999").range("a99").value then
Remember that if you're comparing text, ABC < aBc and ABC < abc (and so forth). If lcase(activecell.value) _ = lcase(worksheets("sheet99999").range("a99").value) then is one way around it if you want to ignore case. Selection can be multiple cells. Activecell will be one cell. Donna S wrote: I'm trying to write a simple if statement that looks at an active cell and compares is to the data in another cell. So far I have: If Selection.Value = ??????? Then Please help me fill in the ???????. This is probably very simple but I'm just learning. Thanks, -- Dave Peterson |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
macro if statements
How do I ask: if selection.value = the value in the cell offset (0,-4)??????
"Miguel Zapico" wrote: This is one option: If Selection.Value = ActiveSheet.Range("A1").Value Then It compares the value on the selected cell with the range A1 of the same worksheet. Hope this helps, Miguel. "Donna S" wrote: I'm trying to write a simple if statement that looks at an active cell and compares is to the data in another cell. So far I have: If Selection.Value = ??????? Then Please help me fill in the ???????. This is probably very simple but I'm just learning. Thanks, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Search, Copy, Paste Macro in Excel | Excel Worksheet Functions | |||
Closing File Error | Excel Discussion (Misc queries) | |||
macro with F9 | Excel Discussion (Misc queries) | |||
Make Alignment options under format cells available as shortcut | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) |