Checking Active Cell Input

Flapjack

Board Regular
Joined
Aug 24, 2005
Messages
61
Office Version
  1. 365
Platform
  1. Windows
I would like to write some code that does the following:

I have a column where the user enters part numbers. Whenever someone enters one part number in particular, I want a dialog box to pop up and have them select from three options. Based on the option they choose, a corresponding part number will then be automatically inserted in that column in the very next row.

I'm new at this, so sorry if this is a basic question, but how do I do an If/Then check on the active cell whenever something is entered? In other words, I am not manually running a macro to check the range of cells. I want it to automatically check the users input and then run the macro if the part number they enter matches a number.

Thanks!
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Try a worksheet_change event.

Right click on the tab of the input sheet, select "view code", and put something like:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = "my part" Then 'rest of code
End Sub
 
Upvote 0
Thanks, Oaktree! That's working just how I want it.

Thanks! :biggrin:
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,581
Members
449,089
Latest member
Motoracer88

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