RE: Run-time error from my code
From: Matt (Matt_at_discussions.microsoft.com)
Date: 06/23/04
- Next message: Alex Smariga: "How do I Copy data dynamically to a calculated cell"
- Previous message: Always Learning: "Re: Excel assumes too much"
- In reply to: Matt: "Run-time error from my code"
- Next in thread: Michael Malinsky: "Re: Run-time error from my code"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 23 Jun 2004 07:55:01 -0700
I get the same problem. My problem is with the .formula line of code. Thanks for trying.
Matt
"Matt" wrote:
> I have this code that is placing a formula in a range of cells if a control checkbox(cbExempt) is false. Then if cbExempt is true, it is clearing the contents of that same range of cells. I am getting a runtime error(1004):Application-defined or object-defined error when I run this code. The problem seems to be the line where it places the formula in the range of cells. At least that is the line that the debugger is highlighting. Any suggestions would be great. Thanks. Matt
>
> Public Sub Formula()
> If Worksheets("TIME AND LEAVE").cbExempt.Value = False Then
> Worksheets("TIME AND LEAVE").Range("C31,E31,G31,I31,K31,M31,O31").Formula = "=IF(RC[1] <> R[-21]C[1],'ERROR','')"
> Else
> Worksheets("TIME AND LEAVE").Range("C31,E31,G31,I31,K31,M31,O31").ClearContents
> End If
> End Sub
- Next message: Alex Smariga: "How do I Copy data dynamically to a calculated cell"
- Previous message: Always Learning: "Re: Excel assumes too much"
- In reply to: Matt: "Run-time error from my code"
- Next in thread: Michael Malinsky: "Re: Run-time error from my code"
- Messages sorted by: [ date ] [ thread ]