Ask User to Must Fill in Cell y if the cell x is = xyz

bhinderwala

New Member
Joined
Dec 12, 2015
Messages
18
Hi

I want the macro which ask user to enter the data let suppose in b1 if a1 = xyz

[TABLE="width: 191"]
<colgroup><col><col></colgroup><tbody>[TABLE="class: grid, width: 191"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Reason
[/TD]
[TD]Expiry Date
[/TD]
[/TR]
[TR]
[TD]Short Date[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Expired[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Master Carton Short[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD] [/TD]
[TD]
[/TD]
[/TR]
</tbody>[/TABLE]
[TR]
[TD]
[/TD]
[/TR]
[TR]

[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] i want to ask the user if the cell contain Short Date or Expired they need to add date in other column
[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi bhinderwala,

your question is not very clear.


  1. The user enters xyz in A1
  2. You want (automatically ) an inputbox to appear asking the user to enter a value in another column.

Now:

  • i don't understand what you mention about short dates or expiry dates
  • What column (or cell) needs the information?
  • Is it not simpler to ask for the value to be entered and enter it using the macro?
 
Upvote 0
Hi Sijpie

Thanks for your reply

I have a drop down list in column A. I want Data entry mandatory to the user to enter in column B if the values in Column A is having "xyz" and "abc" values. ( xyz and abc are examples).
 
Upvote 0
Say that you have
  • your dropdown box in cell A13 (doesn't really matter where), and
  • the linkled cell for the dropdown is named DDLinked, and
  • the input range for the dropdown is named DDinput, and
  • the cell to be filled out is B13


Excel 2010
ABCD
12
13abc
141def
15xyz
16wrt
Sheet2


Then the following macro could be linked to the dropdown to achieve what you need:

<font face=Calibri><SPAN style="color:#00007F">Option</SPAN> <SPAN style="color:#00007F">Explicit</SPAN><br><br><SPAN style="color:#00007F">Sub</SPAN> DropDown1_Change()<br><SPAN style="color:#007F00">' Macro linked to dropdown box _<br>  asking user to supply input for cell B13 (example) _<br>  when the user selects either of the constants _<br>  shown below. _<br>  Macro assumes input range for the dropdown is _<br>  named: 'DDinput' and linked cell for the dropdown _<br>  is named: 'DDLinked'</SPAN><br>  <br>    <SPAN style="color:#00007F">Dim</SPAN> vReply <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Variant</SPAN><br>    <SPAN style="color:#00007F">Const</SPAN> v1 = "xyz"            <SPAN style="color:#007F00">'<<<< to be adjusted</SPAN><br>    <SPAN style="color:#00007F">Const</SPAN> v2 = "abc"            <SPAN style="color:#007F00">'<<<< to be adjusted</SPAN><br>    <SPAN style="color:#00007F">Dim</SPAN> sSelected <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">String</SPAN><br>    <br>    sSelected = Range("DDinput").Cells(Range("DDLinked").Value, 1)<br>    <SPAN style="color:#00007F">If</SPAN> sSelected = v1 <SPAN style="color:#00007F">Or</SPAN> sSelected = v2 <SPAN style="color:#00007F">Then</SPAN><br>        <SPAN style="color:#00007F">Do</SPAN><br>            vReply = InputBox(Prompt:="Please enter a value for cell B13", _<br>                              Title:="Input required")<br>        <SPAN style="color:#00007F">Loop</SPAN> <SPAN style="color:#00007F">While</SPAN> Len(vReply) = 0<br>        Range("B13").Value = vReply   <SPAN style="color:#007F00">'<<<< to be adjusted</SPAN><br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>
 
Upvote 0

Forum statistics

Threads
1,224,144
Messages
6,176,648
Members
452,739
Latest member
SCEducator

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top