Oh, I like this much better than the other format I started with. I guess I
grabbed whatever code that I had and tried to modify it, without thinking to
ask, if I could do it this way. Silly, silly me!
Now I know two ways, with Ron's help, which is good.
Thanks!
Dean
Actually, I have one new problem. I put the following line of code into a
macro that had been working perfectly and now it crashes at this line with
an application defined or object defined error message. Am I screwing up
the syntax again? From what I can tell, both cells C55 and H55 have numbers
in them.
Range("C200").Select
ActiveCell.Formula = "=IF(H55="",0,H55-C55)" ' need to do this because
the cells have moved
Thanks!
Dean
> Oh, I like this much better than the other format I started with. I guess
> I grabbed whatever code that I had and tried to modify it, without
[quoted text clipped - 50 lines]
>>>>
>>>> --ron
Gary Keramidas - 31 Aug 2007 20:36 GMT
2 things:
you don't need to select the cell, and you need to double up the quotes,
Range("C200").Formula = "=IF(H55="""",0,H55-C55)"

Signature
Gary
> Actually, I have one new problem. I put the following line of code into a
> macro that had been working perfectly and now it crashes at this line with an
[quoted text clipped - 60 lines]
>>>>>
>>>>> --ron
Ron Rosenfeld - 31 Aug 2007 20:41 GMT
>Actually, I have one new problem. I put the following line of code into a
>macro that had been working perfectly and now it crashes at this line with
[quoted text clipped - 8 lines]
>Thanks!
>Dean
Yes, you are screwing up the syntax again. Your problem is with the included
quote marks, as I wrote previously:
...=IF(H55="""",0,...
> When you have quote marks within your formula, which is a string,
> you've got to
> double them so VBA doesn't think it's the end of the string:
--ron
Dean - 31 Aug 2007 21:33 GMT
Ah, yes, that short term memory thing! I'm sorry. Thanks to you both for
responding.
Dean
>>Actually, I have one new problem. I put the following line of code into a
>>macro that had been working perfectly and now it crashes at this line with
[quoted text clipped - 21 lines]
>
> --ron