Using a script to fill in a cell based on a cell value

pyclen

Board Regular
Joined
Jan 17, 2022
Messages
85
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi All,

I am trying to figure out how to do this either w/VBA or the newer OfficeScripts

I have a similar XL file as below where I want to have a user selection of whether a tablet or capsule is made, then depending on that input and if no input is provided in the cell below (highlighted) I want to have the opportunity to run a script (VBA or the newer ones) to enter an assumed equipment train.

Example: if the user selects a tablet and does not provide any equipment in the cell below, the standard process of high shear, Dry blend, direct compression, non-functional coating is used and I want to enter that by running a script when the button is pushed.
yes I will make the two rows (H&I) with the data named ranges
What is the best way to achieve that?

thank you in advance for any suggestions


Book1
BCDEFGHIJK
3tablethigh shear, Dry blend, direct compression, non-functional coating
4Dosagecapsulehigh shear, Dry blend, Encapsulation
5Equipment
6
Sheet1
Cells with Data Validation
CellAllowCriteria
C4List=$H$3:$H$4
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Forum statistics

Threads
1,215,339
Messages
6,124,365
Members
449,155
Latest member
ravioli44

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