Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1465
How to set Min/Max value of a cell
posted

Hello.

I know that the MinValue and MaxValue can be set on a column level, but how do you set it on a cell level?

I've managed a workaround by setting those properties on the column in the "BeforeEnterEditMode" event, but I'm not sure that that's the best way (see code, below).

Is there a better way?

Thanks in advance,

Mike

 

 

 

 

 

Private Sub ugIncludedItems_BeforeEnterEditMode(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles

ugIncludedItems.BeforeEnterEditMode

ugIncludedItems.ActiveCell.Column.MaxValue =

 

 

CInt(ugIncludedItems.ActiveCell.Row.Cells("MAXQTY"

).Value)

ugIncludedItems.ActiveCell.Column.MinValue = 0

 

 

 

End

Sub