简体   繁体   中英

Change Excel Drop-down selection based on status of another column

I have an Excel doc that has a named list in the "G" column, consisting of numbers 1-4 and 9999 that indicate project priority (they also have conditional code on them that changes the color of the row based on selection.

In column "H" I have a progress counter that lets the user enter one of 4 percentages 25/50/75/100.

does anyone know how to make it so that if column H is set to 100, it would change the status of the "G" column to "9999" (the fifth selection on the DD list.)?

Easiest way is to just prefill column G with a formula. Eg in G2:

=IF(H2=100,9999,"")

You can still apply the drop down validation on top of a cell with a formula. The formula will be overwritten with whatever value is chosen from the drop down menu.

If you need to be able to specify a value in the G column and then still have it automatically change to 9999 later, you'll either need to use a 3rd column that always holds a formula referencing both columns G and H:

=IF(H2=100,9999,G2)

Or you'll need to write VBA that runs on the Worksheet_Change event. It the Target is in column H and has a value of 9999, then it will update the value of the cell in column G and the same row as the Target.

I put all data tables and standalone formula on a separate hidden worksheet.

How about

=IF('Sheet_Name'!H:H=100,9999,G2)

or

=IF(Sheet1!H:H=100,9999,G2)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM