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

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
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,216,105
Messages
6,128,859
Members
449,472
Latest member
ebc9

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