Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That worked. Thanks. Any ideas on how to check 6 other ranges on the same sheet? With an if/elseif statement. It seems like if I put too much code in the worksheet_change sub some of the other code in the sub doesn't run too well. Any ideas? Thanks again. Matt
"keepITcool" wrote: Matt wrote : When I add NOT in the code, it doesn't do anything at all. Matt Ouch :( Lets try again.. in this line Range("D10") Is Not Null you are comparing a range OBJECT to Null... which wont work.. you want to check that the range is not an empty cell. following is almost equivalent: If NOT IsEmpty(Range("d10")) then if Range("D10") < "" then if Len(Range("d10") < 0 then if Len(Trim(Range("d10")) < 0 then 'last one would also check for cells where the user cleared the cell with his spacebar.. Re syntax: in VBA syntax uses IS only to compare OBJECTS. and that the Null value is not used very often in Excel. Intersect(Target,Range("d10")) returns a range object Compare it to the NOTHING object Negate would lead to : If NOT intersect(a,b) IS nothing whereas If Intersect(a,b) IS NOT NOTHING gives a syntax error. -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help Identifying code statement | Excel Discussion (Misc queries) | |||
If statement to replace #VALUE! code | Excel Worksheet Functions | |||
Code execution skips Application.Run statement | Excel Programming | |||
Simple code error statement | Excel Programming | |||
Quick VBA code question (if...then statement) | Excel Programming |