Automating the entry of text in Target cell when some value is entered in another cell

laxminarayana

Board Regular
Joined
Nov 16, 2013
Messages
56
Hello,

Is it possible that selecting an item from drop down should enter certain text in a target cell ?

Following image will show, what i am trying achieve

http://s8.postimg.org/70i4m3mut/ster1.png

In cell "N16" there is a drop down with two items 1) pay due 2) Bill

Selecting (pay due) should enter following text

"Payments are due from the dealer, requires special attention." in cell C3

if (Bill) is selected from drop down then it should enter below text

"Require bills to continue with the transaction." should appear in cell C3"

if both (pay due) and (Bill) selected both lines should appear in cell "C3" with one line spacing between them.


Thanks
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I would do a Worksheet Change event... maybe something along the lines of:


<code>
Code:
Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ErrorHandler:
If Intersect(Target, Range("N16")) Is Nothing Then Exit Sub

Select Case Range("N16").Value
    Case "pay due"
        Range("C3").Value = "Payments are due from the dealer, requires special attention."
    Case "bill"
        Range("C3").Value = "Require bills to continue with the transaction."
    Case "pay due & bill"
        Range("C3").Value = "Payments are due from the dealer, requires special attention." & vbNewLine & vbNewLine & "Require bills to continue with the transaction."
End Select

ErrorHandler:
End Sub

Was not quite sure how you are storing the value for both, so you might need to adjust the value for the third case.

Also since this is a worksheet change event, you will need to put it in the worksheet code...

Worksheet_Code.gif


Hope that helps!




Edit: Sorry sometimes I over think things.. you could also just use a simple "IF" in "C3"...

Code:
=IF(N16="pay due","Text here",IF(N16="bill","Text Here",IF(N16="pay due & bill","First Text Here"&CHAR(10)&CHAR(10)&"Second Text Here","")))
</code>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,967
Members
452,371
Latest member
Frana

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