Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Data Validation
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? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
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? |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Data Validation
i'll try it now...
"Bob Umlas, Excel MVP" wrote: 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? |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Data Validation
Hey man, that worked! Thx for the advice... still a newbie with VBA...
Cya "Bob Umlas, Excel MVP" escreveu: 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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Data validation | Excel Worksheet Functions | |||
Macro question | Excel Worksheet Functions | |||
Inputting data to one worksheet for it effect another | Excel Discussion (Misc queries) | |||
named range, data validation: list non-selected items, and new added items | Excel Discussion (Misc queries) | |||
Pulling data from 1 sheet to another | Excel Worksheet Functions |