sjoerd.bosch
New Member
- Joined
- Feb 9, 2012
- Messages
- 49
Hi. I am looking for a VBA code what prevents a result of a formula to exceed 98% (the number 98 only will do)
The cells(s) which I want to restrict contain formulas, which will not allow me to use the data function in excel.
the VBA code must return with a msg box telling the user to enter a valid number
Like in the below image - I enter in the Ullage UTI Cell(s) (blue) a certain measurement in mm - it then calculates a correction and gives me a new Final Ullage and in the next cell a percentage. If the final ullage exceeds a maximum allowable number it would result in more than 98% volume loaded in the next cell.
If that is the case, I want the program to stop calculating and show an error message saying something like - "Error! You are overloading the tank. Please enter a valid Ullage"
The actual message is not very important.
I just cannot find any solution because the cell I want to restrict contains a formula which refers to another cell.
Your kind assistance is very much appreciated.
The cells(s) which I want to restrict contain formulas, which will not allow me to use the data function in excel.
the VBA code must return with a msg box telling the user to enter a valid number
Like in the below image - I enter in the Ullage UTI Cell(s) (blue) a certain measurement in mm - it then calculates a correction and gives me a new Final Ullage and in the next cell a percentage. If the final ullage exceeds a maximum allowable number it would result in more than 98% volume loaded in the next cell.
If that is the case, I want the program to stop calculating and show an error message saying something like - "Error! You are overloading the tank. Please enter a valid Ullage"
The actual message is not very important.
I just cannot find any solution because the cell I want to restrict contains a formula which refers to another cell.
Your kind assistance is very much appreciated.