Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to have certain cells to be validated for decimals as a
user makes an input into Excel cells. I create an Excel file in my VB6 code and I have the following code for validation in my VB6: m_objExcel.ActiveSheet.Range("k1:k" & CStr(iCells + 1)).Select For Each rng In m_objExcel.ActiveSheet.Range("k1:k" & CStr(iCells)) With rng.Validation .Add Type:=xlValidateDecimal, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:="0", Formula2:="10000000" .ErrorMessage = "Please enter a number from 0 to 10000000" End With Next rng The code compiles and runs fine, but no validation is being performed when I try to enter "abc" in a k row (the row I am validating in the code above.) (I also tried Formula1:="=0", Formula2:="=10000000") Please give me a hand. I am completing my project and this is the only problem that holds me up now. Thanks anyone!! Yuri |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Validation Problem | Excel Discussion (Misc queries) | |||
macro Excel problem link cells with Data-Validation option | Excel Discussion (Misc queries) | |||
Problem with length of validation list in Excel 2002 | Excel Worksheet Functions | |||
Tricky problem in Data validation - Excel 2003 | Excel Discussion (Misc queries) | |||
Validation problem... | Excel Worksheet Functions |