Thanks,
This is what I did in the end:
Cells(1, 4) = "=COUNTIF(R[0]C[-1]:R[" & c & "]C[-1],""Total"")"
m = Cells(1, 4).Value
Cells(1, 4).Select
Selection.Clear
MsgBox m & " totals"
Peter
Don Guillett wrote:
> or
> for each c in range("a2:a22")
> if ucase(c)="TOTAL" then mc=mc+1
> next
> msgbox mc
>
> --
> Don Guillett
> SalesAid Software
> (E-Mail Removed)
> "Peter" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Thanks for the reply but countif does not seem to work in VBA. Sorry
> > for not being clear in my question but I am writing a macro in VBA. If
> > you can do it in Excel I'm sure you can do it in VBA.
> >
> > Thanks,
> >
> > Peter
> >