DIGIT-ARC read-only archive · snapshot: July 23, 2026

VB in Excel

4 posts · originally from https://geek.digit.in/community/threads/vb-in-excel.109153/

Cool Buddy
Cool Buddy Original post #1
Feb 22, 2009 at 11:28 AM
is it possible to perform data validation in excel through VB. If so how.

This is what I need to do:
if a cell's (say d6) value is greater than 50, generate a message saying that maximum value permitted is 50.
if the product of this cell and another cell (say d7) exceed 600, generate a message saying that this value cannot be entered.
R
Feb 22, 2009 at 2:45 PM
I don't know much about VB, but through excel's menu system this can be done. data>validation>allow>whoole number>between>enter the setting here. you can enter the error message the user will get if he enters wrong number say 51, in the error alert tab. This is very easy to do.

*img410.imageshack.us/img410/6722/validation1.th.jpg

[img=*img100.imageshack.us/img100/4623/validation2.th.jpg]

more here

*www.contextures.com/xlDataVal06.html#Whole
Cool Buddy
Feb 23, 2009 at 3:23 PM
yes this is really easy, but I knew this. If you look at my question closely i want to generate 2 error messages for different values, this is not possible through data validation.
Pat
Pat #4
Feb 23, 2009 at 3:48 PM
Yes, take a look at Macros. Should not be too difficult..