Re: Code to Insert Formula in Cell
- From: "Paige" <Paige@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 30 Apr 2005 17:28:02 -0700
Rob, thanks. Does this go into the work*** module? Under what type of
declaration? I'm still having problems and think it must be because I don't
have it in the right type of module or the correct declaration.
"Rob Bovey" wrote:
> Hi Paige,
>
> This works for me:
>
> Worksheets("B").Range("B10").Formula = _
> "=if(A!RANGE1=12,""this is a Test"",0)"
>
> --
> Rob Bovey, Excel MVP
> Application Professionals
> http://www.appspro.com/
>
> * Take your Excel development skills to the next level.
> * Professional Excel Development
> http://www.appspro.com/Books/Books.htm
>
> "Paige" <Paige@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:8CCD9615-5681-41B9-92B4-538DBB086C36@xxxxxxxxxxxxxxxx
> > Example: I have one file with 2 worksheets (A and B). I want to have the
> > following formula in cell B10 of work*** B: If range name RANGE1 on
> > work*** A = 12, then insert the following text - "this is a test";
> > otherwise, insert a 0.
> >
> > I had:
> > Worksheets("B").Range("B10").Formula = "=if('A'!RANGE1="12","this is a
> > test",0)"
> > but kept getting error messages. Tried with and without all types of
> > quotes
> > and multiple other things, but still got various error messages like
> > application defined error, syntax error, or range property, etc.
> >
> > Am I reference this correctly (obviously not). Also, where would this
> > go -
> > into the module for work*** B? What type of declaration (calculate?); I
> > may not have that correct either (tried all different kinds).
> >
> > Appreciate any help that can be provided. Thanks.
>
>
>
.
- Follow-Ups:
- Re: Code to Insert Formula in Cell
- From: Rob Bovey
- Re: Code to Insert Formula in Cell
- Prev by Date: Re: Displaying Timer
- Next by Date: Re: SUMIF Question
- Previous by thread: Re: Displaying Timer
- Next by thread: Re: Code to Insert Formula in Cell
- Index(es):