Re: how to count total record and amount

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Frank Kabel (frank.kabel_at_freenet.de)
Date: 10/15/04


Date: Fri, 15 Oct 2004 02:19:05 -0700

Hi
easy workaround:
Put this formula in the first row of your data and suse
=SUM(A2:A1000)
and
=COUNTA(A2:A1000)

This should deal with variable record numbers. No need for vBA here (as the
user has to run a macro anyway manually)

"mango" wrote:

> dear frank,
> i want to automate it as i dun know how many record user will put in
> currently i put this function(count and sum) at row 200 as user told me
> normally they only process about 100 records.
>
>
> "Frank Kabel" wrote:
>
> > Hi
> > why use a macro?. Why not use the functions
> > =SUM(B:B)
> > and
> > =COUNTA(B:B)
> >
> > --
> > Regards
> > Frank Kabel
> > Frankfurt, Germany
> >
> > "mango" <mango@discussions.microsoft.com> schrieb im Newsbeitrag
> > news:562E6F3C-4E43-4618-8B52-B510C4F95C7F@microsoft.com...
> > > dear all, hope can help.
> > > 1)how to do counting and sum(number of records input) using macro. i
> > want to
> > > automate. in actual case i do not know how many records user input.
> > so i want
> > > it to count/sum automatically.
> > >
> > > customer amount
> > > abc 20
> > > xyz 45
> > > utf 22 the total record is 3 and
> > amount is
> > > 87. how to
> > > automate in macro to count
> > and sum
> > > automatically
> > > in macro?
> > >
> > > 2) how to put the statement in macro to do save? i want to save the
> > file in
> > > this format where company i get from button caption.
> > > {company}{date}.txt
> > > thebest23092004.txt
> > >
> > >
> > >
> >
> >



Relevant Pages

  • Re: Importing Excel Data - Recognizing Headers
    ... some VBA code that the macro would call. ... workbook somewhere on their individual network. ... to see that first row as having headers in them. ...
    (microsoft.public.access.externaldata)
  • Re: Autofill macro question
    ... the first row of the extendable data area is the ... I need some assistance with a macro. ... determined by the column immediately preceeding the formulas. ...
    (microsoft.public.excel.programming)
  • RE: code to go down a column and find the last cell with data before a
    ... Ensure that you make a backup copy of your workbook to run the macro in case ... Data needs to start at cell A1 with NO COLUMN HEADERS or any other data on ... Dim lastCol As Integer 'Last column with initial data ... the data in the first row in 31 columns. ...
    (microsoft.public.excel.programming)
  • Re: Mail merge and long tables
    ... I tried running the macro that you supplied, however i am getting an error. ... So on every page the header row from ... the first row, ... data from Access by using the directory option. ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Random?
    ... When you record the macro to sort ... and paste the first row, ... SkipBlanks:= _ ... the sort sheet to the destination sheet). ...
    (microsoft.public.excel)