Put in "PIN" change to Initial

rtroehrig

New Member
Joined
May 2, 2018
Messages
49
Office Version
  1. 365
Platform
  1. Windows
Ok, so I know how to do this using a back page sheet

=IFS(Sheet2!B1=1234,"GM",Sheet2!B1=2345,"AP",Sheet2!B1=FALSE,"")

But what I ultimately need and can't figure out is how to do this in the same cell. Rather than typing the "PIN" in Sheet2 B1 to input the initial in Sheet 1 M2, I need to be able to type the "PIN" into Sheet 1 M2 and have it change to the initial when I hit enter and leave the cell.

Any ideas?
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
You could use a worksheet change event. By placing this code in the Sheet Module.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
 
If Target.Address = "$M$2" Then
    If Target.Value = "1234" Then
    Target.Value = "GM"
    ElseIf Target.Value = "2345" Then
    Target.Value = "AP"
    End If
End If
 
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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