Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate Cell with another cell, but only if the date equals today GaryS Excel Worksheet Functions 4 May 1st 08 04:39 AM
If a cell equals _, at the next row that equals _, return value fr CathyH Excel Worksheet Functions 10 May 2nd 07 07:53 PM
If cell is left blank, or equals zero, then cell equals a different cell John McMurry Excel Discussion (Misc queries) 3 April 13th 07 01:14 PM
Very Basic Problem - Merged Cell Equals Contents of a Single Cell jollynicechap Excel Worksheet Functions 3 December 29th 06 08:16 PM
How to create/run "cell A equals Cell B put Cell C info in Cell D abmb161 Excel Discussion (Misc queries) 5 January 26th 06 06:36 PM


All times are GMT +1. The time now is 11:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"