Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple VB to Select a Cell if Another Cell Equals a Value
Hi!
I'm looking for simple VB code that says if Cell A1 = "X" then select cell Y. If Cell Y is selected I want a box that pops up to prompt the user to enter the information. Is that possible? I saw something similar, but I can't seem to get it to work. Any help would be extremely appreciated. Best regards, Kerrick Sawyers |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple VB to Select a Cell if Another Cell Equals a Value
"ksawyers" wrote: Hi! I'm looking for simple VB code that says if Cell A1 = "X" then select cell Y. If Cell Y is selected I want a box that pops up to prompt the user to enter the information. Is that possible? I saw something similar, but I can't seem to get it to work. Any help would be extremely appreciated. Best regards, Kerrick Sawyers |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple VB to Select a Cell if Another Cell Equals a Value
Sub selectAndPopulateNewCell()
If UCase(Range("A1").Value) = "X" And Range("Y1").Value = "" Then Range("Y1").FormulaR1C1 = InputBox("Enter Value Here") End If End Sub "ksawyers" wrote: Hi! I'm looking for simple VB code that says if Cell A1 = "X" then select cell Y. If Cell Y is selected I want a box that pops up to prompt the user to enter the information. Is that possible? I saw something similar, but I can't seem to get it to work. Any help would be extremely appreciated. Best regards, Kerrick Sawyers |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple VB to Select a Cell if Another Cell Equals a Value
Thanks Jim! Unfortunately that didn't work. I have a range of cells that I
named and tried to insert in the formula but nothing happens when I enter the value in the cell (A1) - actually I have a dropdown in the cell with options to select. When I select the option, I want it to jump to the other cell and if blank prompt for the new information. I'll keep trying. Thanks! "Jim F" wrote: Sub selectAndPopulateNewCell() If UCase(Range("A1").Value) = "X" And Range("Y1").Value = "" Then Range("Y1").FormulaR1C1 = InputBox("Enter Value Here") End If End Sub "ksawyers" wrote: Hi! I'm looking for simple VB code that says if Cell A1 = "X" then select cell Y. If Cell Y is selected I want a box that pops up to prompt the user to enter the information. Is that possible? I saw something similar, but I can't seem to get it to work. Any help would be extremely appreciated. Best regards, Kerrick Sawyers |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple VB to Select a Cell if Another Cell Equals a Value
You need to run the code from the workbook changed event.
"ksawyers" wrote: Thanks Jim! Unfortunately that didn't work. I have a range of cells that I named and tried to insert in the formula but nothing happens when I enter the value in the cell (A1) - actually I have a dropdown in the cell with options to select. When I select the option, I want it to jump to the other cell and if blank prompt for the new information. I'll keep trying. Thanks! "Jim F" wrote: Sub selectAndPopulateNewCell() If UCase(Range("A1").Value) = "X" And Range("Y1").Value = "" Then Range("Y1").FormulaR1C1 = InputBox("Enter Value Here") End If End Sub "ksawyers" wrote: Hi! I'm looking for simple VB code that says if Cell A1 = "X" then select cell Y. If Cell Y is selected I want a box that pops up to prompt the user to enter the information. Is that possible? I saw something similar, but I can't seem to get it to work. Any help would be extremely appreciated. Best regards, Kerrick Sawyers |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple VB to Select a Cell if Another Cell Equals a Value
Jim,
Sorry, how do I do that? "Jim F" wrote: You need to run the code from the workbook changed event. "ksawyers" wrote: Thanks Jim! Unfortunately that didn't work. I have a range of cells that I named and tried to insert in the formula but nothing happens when I enter the value in the cell (A1) - actually I have a dropdown in the cell with options to select. When I select the option, I want it to jump to the other cell and if blank prompt for the new information. I'll keep trying. Thanks! "Jim F" wrote: Sub selectAndPopulateNewCell() If UCase(Range("A1").Value) = "X" And Range("Y1").Value = "" Then Range("Y1").FormulaR1C1 = InputBox("Enter Value Here") End If End Sub "ksawyers" wrote: Hi! I'm looking for simple VB code that says if Cell A1 = "X" then select cell Y. If Cell Y is selected I want a box that pops up to prompt the user to enter the information. Is that possible? I saw something similar, but I can't seem to get it to work. Any help would be extremely appreciated. Best regards, Kerrick Sawyers |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple VB to Select a Cell if Another Cell Equals a Value
Ok...
1. Open VBA Editor. 2. Click on "ThisWorkbook" in the VBA project section (to the left of the editor). 3. In the first dropdown list (at top of editor) choose "workbook" 4. In the sencond drop down (at top of editor) choose "SheetChange" It should automatically add some code: 5. between the "private sub" and "end sub" statments copy the following code: If UCase(Range("A1").Value) = "X" And Range("Y1").Value = "" Then Range("Y1").FormulaR1C1 = InputBox("Enter Value Here") End If "ksawyers" wrote: Jim, Sorry, how do I do that? "Jim F" wrote: You need to run the code from the workbook changed event. "ksawyers" wrote: Thanks Jim! Unfortunately that didn't work. I have a range of cells that I named and tried to insert in the formula but nothing happens when I enter the value in the cell (A1) - actually I have a dropdown in the cell with options to select. When I select the option, I want it to jump to the other cell and if blank prompt for the new information. I'll keep trying. Thanks! "Jim F" wrote: Sub selectAndPopulateNewCell() If UCase(Range("A1").Value) = "X" And Range("Y1").Value = "" Then Range("Y1").FormulaR1C1 = InputBox("Enter Value Here") End If End Sub "ksawyers" wrote: Hi! I'm looking for simple VB code that says if Cell A1 = "X" then select cell Y. If Cell Y is selected I want a box that pops up to prompt the user to enter the information. Is that possible? I saw something similar, but I can't seem to get it to work. Any help would be extremely appreciated. Best regards, Kerrick Sawyers |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple VB to Select a Cell if Another Cell Equals a Value
Thanks Jim!
"Jim F" wrote: Ok... 1. Open VBA Editor. 2. Click on "ThisWorkbook" in the VBA project section (to the left of the editor). 3. In the first dropdown list (at top of editor) choose "workbook" 4. In the sencond drop down (at top of editor) choose "SheetChange" It should automatically add some code: 5. between the "private sub" and "end sub" statments copy the following code: If UCase(Range("A1").Value) = "X" And Range("Y1").Value = "" Then Range("Y1").FormulaR1C1 = InputBox("Enter Value Here") End If "ksawyers" wrote: Jim, Sorry, how do I do that? "Jim F" wrote: You need to run the code from the workbook changed event. "ksawyers" wrote: Thanks Jim! Unfortunately that didn't work. I have a range of cells that I named and tried to insert in the formula but nothing happens when I enter the value in the cell (A1) - actually I have a dropdown in the cell with options to select. When I select the option, I want it to jump to the other cell and if blank prompt for the new information. I'll keep trying. Thanks! "Jim F" wrote: Sub selectAndPopulateNewCell() If UCase(Range("A1").Value) = "X" And Range("Y1").Value = "" Then Range("Y1").FormulaR1C1 = InputBox("Enter Value Here") End If End Sub "ksawyers" wrote: Hi! I'm looking for simple VB code that says if Cell A1 = "X" then select cell Y. If Cell Y is selected I want a box that pops up to prompt the user to enter the information. Is that possible? I saw something similar, but I can't seem to get it to work. Any help would be extremely appreciated. Best regards, Kerrick Sawyers |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Populate Cell with another cell, but only if the date equals today | Excel Worksheet Functions | |||
If a cell equals _, at the next row that equals _, return value fr | Excel Worksheet Functions | |||
If cell is left blank, or equals zero, then cell equals a different cell | Excel Discussion (Misc queries) | |||
Very Basic Problem - Merged Cell Equals Contents of a Single Cell | Excel Worksheet Functions | |||
How to create/run "cell A equals Cell B put Cell C info in Cell D | Excel Discussion (Misc queries) |