View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default If statement not working

What is Deleted_Today? Is it a range name in Excel, or is it a VBA variable?
If as I suspect it is the latter, is it a string or a range? What did you
initialise it to?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"excelnut1954" wrote in message
ups.com...
On Nov 23, I got a respons on how to construct an IF statement to
redirect the flow of a macro. I was given the coding to solve the
problem. I wasn't able to continue with the project until today. I've
changed it a little from what I was given here because of the creation
of 2 new subs I wanted to include in the flow of control. But, I'm
having a problem with it.

The macro is suppose to check the range "Deleted_Today". If it is 0,
then I wanted to redirect to a sub named FormatCells. If there was a
number in there, then it would go to a sub named Move_Deleted_Records.

As always, I appreciate all the responses I've gotten here. However, I
get an error, and it highlights the 1st line. I've check to make sure
the spelling of the range name, and the 2 subs are correct. Can someone
help explain why this is hanging up?
Thanks,


If Range("Deleted_Today") = 0 Then
FormatCells
Else
Move_Deleted_Records
End If