Thread: Data Validation
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Umlas, Excel MVP Bob Umlas, Excel MVP is offline
external usenet poster
 
Posts: 320
Default Data Validation

The macro could do something like this:
Sub MaybeSave()
If Range("F3").value<17 or _
Range("G12").value < "Bob" or _
Range("G15").value < "Ken" or _
Range("F1").value < 33 or _
Range("A8").value < 44 or _
Range("B33").value < "Joe" then
Msgbox "Please Fill in the appropriate fields before this can
succeed.",vbexclamation
Exit Sub
End If
'Continue with whatever you had here.....
End Sub

"mantros" wrote:

Hey folks,

Need help again...
C, i have a workbook wich destination is to work as a research one between
my clients.

I've made the whole thing and 've inserted a button with a macro that save
the file, right in the end of the sheet that wors as kind of a form.

My problem is that i want that macro, before it saves the file, do a kind of
validation of the data inserted in six different cells, denying the save
command and poping a validation error if the data is invalid.

Could u help, plz?