ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Required fields (https://www.excelbanter.com/excel-programming/300163-required-fields.html)

Lupe[_2_]

Required fields
 
Hell
In Col E I have equipment list, in Col F I have equipment status with data validation, and in Col G I have status explanation. For select equipment status ie., x,y, or z ....I would like the explanation to be required. E.g., Once I enter status X, pop up displays "Please enter a valid explanation" How do I accomplish this
Thank


Tom Ogilvy

Required fields
 
Right click on the sheet tab and select view code. Paste in code like this:

Private Sub Worksheet_Change(ByVal Target As Range)
if Target.count 1 then exit sub
if Target.column = 5 then
if isempty(cells(target.row,6)) then
msgbox "Please enter an explanation"
end if
End if
End Sub

this will work in xl2000 and later. In Excel 97, it will only work if the
source list for your data validation is entered in the list textbox

--
Regards,
Tom Ogilvy

"Lupe" wrote in message
...
Hello
In Col E I have equipment list, in Col F I have equipment status with data

validation, and in Col G I have status explanation. For select equipment
status ie., x,y, or z ....I would like the explanation to be required.
E.g., Once I enter status X, pop up displays "Please enter a valid
explanation" How do I accomplish this?
Thanks





All times are GMT +1. The time now is 02:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com