Re: Display CountA Formula and Text String in a cell by henryonyeagbako
henryonyeagbako
Sun Mar 16 13:22:11 CDT 2008
On Mar 16, 12:37=A0am, Dave Peterson <peter...@verizonXSPAM.net> wrote:
> I'd use rng.formulaR1C1:
>
> rng.FormulaR1C1 =3D "=3DCOUNTA(R[-4]C:R[-1]C)" _
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 & " & " & """ assets Aquired in th=
e selected period ""&" _
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 & """" & Format$(first, "short dat=
e") _
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 & " - " & Format$(last, "short dat=
e") & """"
>
>
>
>
>
> henryonyeagb...@hotmail.com wrote:
>
> > I have the following line of code that inserts into a particular cell
> > the count of the No. of asset records listed above it plus a text
> > string declaring " Assets in the selected period" plus it takes the
> > date value of two variables and formats them and places them in cell
> > along the text
>
> > rng.Formula =3D "=3DCOUNTA(R[-4]C:R[-1]C)" & "&"" assets Aquired in the
> > selected period " & "" & Format$(first, "short date") & "" - "" &
> > Format$(last, "short date")
>
> > My problem is that this does not display as i would have liked the
> > dates are merely displayed as decimal numbers. I have changed the
> > format of the cell to correct this but that does not appear to alter
> > anything.
>
> > How do i get the cell to display the count for the cells display the
> > text message and the =A0criteria range in the same cell
>
> --
>
> Dave Peterson- Hide quoted text -
>
> - Show quoted text -
Thanks for that it worked like a charm but now how do i get the
followiing to work also:-
rng.FormulaR1C1 =3D "=3DCOUNTA(" & ActiveCell.Offset(-1, 0).Address & ":$A
$9)" & " & " & """ assets Aquired in the selected period ""&" & """" &
Format$(first, "short date") & " - " & Format$(last, "short date") &
""""