Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
What's wrong with this code?
If Selection.SpecialCells(xlConstants) Is Nothing Then
Exit Sub Else Selection.SpecialCells(xlConstants).ClearContents End If Basically, if the cells in question (either a selection or a range) are already cleared then I do not want the sub run, otherwise I want it run. The above is not trapping that condition as the last line before End If always runs and brings up the error 'no cells' - I do not want this error to be shown, just want the code to terminate in that case. tia James |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
What the F@#% is wrong with this code?? | Excel Programming | |||
HELP! What's wrong with my code? | Excel Programming | |||
HELP! What's wrong with my code? | Excel Programming | |||
What's wrong with the code,pls hv a look | Excel Programming | |||
What's wrong with this bit of code | Excel Programming |