can you make a cell value required?

  • Thread starter Thread starter nishapurohit
  • Start date Start date
N

nishapurohit

I am sending a excel spreadsheet out to my end users to collect busines
related data.

I'd like to make a cell value required, is this possible?

If answer to question asked in column F is "YES", make column E
required. Can this be done using excel
 
I'd use column G:

=if(f2<>"yes","","Please answer the question in column E!")

Format it in nice big bold red letters.
 
Once you've got your answer you can write a macro that will run when the
workbook is saved. Maybe not the most succinct method, but the only one
I know:

In 'ThisWorkbook' write:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If Cells(y1,6).value = "yes" then
If Cells(y2,5).value = "" then
MsgBox("Please enter value in cell y2,5)
Cancel = True
End If
End If
End Sub

where y1 and y2 are the relevant rows.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top