ISTEXT function

J

jmorgs

I am trying to make it so that the worksheet will not allow you to leav
a certain cell blank. I am trying to do it with a custom settings i
Data-Validation using ISTEXT but it is not working. Anyone have
better idea
 
F

Frank Kabel

Hi
you could for example put the following code in your workbook module
(not in a standard module):
Private Sub Workbook_BeforeClose(Cancel As Boolean)
if me.worksheets("sheet1").range("A1")="" then
msgbox "Cell A1 is empty. Fill it"
cancel=true
end if

End Sub
 
J

jmorgs

Hi,
The code makes sense to me (I have experienc with Microsoft Acces
code), but now the problem is figuring out where to put it and when i
will work.
I have tried using anotehr sheet and inserting this code, but with cel
A1 blank, no matter where I click it won't give me the message. I pu
the code in Micorsoft Script Editor. Do you know what I'm doin
wrong?
THANK YOU SO MUCH
 
D

Dave Peterson

I like to just format an adjacent cell in big, bold, red letters:

=if(a1<>"","","<--- Please fill in this cell!")
 
Top