+ Reply to Thread
Results 1 to 5 of 5

Insert and sum in empty cell

  1. #1
    salsal
    Guest

    Insert and sum in empty cell

    Hi,

    I need help in writing the macro to do the following:

    After sorting by column R, I need to insert a line between the groups,
    and then sum the total of column M for both groups (see below)


    Column M Column R
    14.50 03COM
    14.50 03COM
    14.50 03COM
    14.50 03COM
    58.00 <-------------
    14.50 05IT
    14.50 05IT
    29.00 <--------------

    Can you please help me?

    Thanks!


  2. #2
    CLR
    Guest

    RE: Insert and sum in empty cell

    Take a look at Data > Subtotals > and follow the menus........

    Vaya con Dios,
    Chuck, CABGx3



    "salsal" wrote:

    > Hi,
    >
    > I need help in writing the macro to do the following:
    >
    > After sorting by column R, I need to insert a line between the groups,
    > and then sum the total of column M for both groups (see below)
    >
    >
    > Column M Column R
    > 14.50 03COM
    > 14.50 03COM
    > 14.50 03COM
    > 14.50 03COM
    > 58.00 <-------------
    > 14.50 05IT
    > 14.50 05IT
    > 29.00 <--------------
    >
    > Can you please help me?
    >
    > Thanks!
    >
    >


  3. #3
    salsal
    Guest

    Re: Insert and sum in empty cell

    Thanks! That's good! But I need this to be written in a macro in order
    to use it in other workbooks.

    thx!

    CLR wrote:
    > Take a look at Data > Subtotals > and follow the menus........
    >
    > Vaya con Dios,
    > Chuck, CABGx3
    >
    >
    >
    > "salsal" wrote:
    >
    > > Hi,
    > >
    > > I need help in writing the macro to do the following:
    > >
    > > After sorting by column R, I need to insert a line between the groups,
    > > and then sum the total of column M for both groups (see below)
    > >
    > >
    > > Column M Column R
    > > 14.50 03COM
    > > 14.50 03COM
    > > 14.50 03COM
    > > 14.50 03COM
    > > 58.00 <-------------
    > > 14.50 05IT
    > > 14.50 05IT
    > > 29.00 <--------------
    > >
    > > Can you please help me?
    > >
    > > Thanks!
    > >
    > >



  4. #4
    CLR
    Guest

    Re: Insert and sum in empty cell

    Try this............

    Sub SubtotalColumnM()
    Application.DisplayAlerts = False
    Columns("M:R").Select
    Selection.Subtotal GroupBy:=6, Function:=xlSum, TotalList:=Array(1, 6),
    _
    Replace:=True, PageBreaks:=False, SummaryBelowData:=True
    Range("Q12").Select
    Application.DisplayAlerts = True
    End Sub

    Vaya con Dios,
    Chuck, CABGx3


    "salsal" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks! That's good! But I need this to be written in a macro in order
    > to use it in other workbooks.
    >
    > thx!
    >
    > CLR wrote:
    > > Take a look at Data > Subtotals > and follow the menus........
    > >
    > > Vaya con Dios,
    > > Chuck, CABGx3
    > >
    > >
    > >
    > > "salsal" wrote:
    > >
    > > > Hi,
    > > >
    > > > I need help in writing the macro to do the following:
    > > >
    > > > After sorting by column R, I need to insert a line between the groups,
    > > > and then sum the total of column M for both groups (see below)
    > > >
    > > >
    > > > Column M Column R
    > > > 14.50 03COM
    > > > 14.50 03COM
    > > > 14.50 03COM
    > > > 14.50 03COM
    > > > 58.00 <-------------
    > > > 14.50 05IT
    > > > 14.50 05IT
    > > > 29.00 <--------------
    > > >
    > > > Can you please help me?
    > > >
    > > > Thanks!
    > > >
    > > >

    >




  5. #5
    salsal
    Guest

    Re: Insert and sum in empty cell

    Great! Thanks!

    CLR wrote:
    > Try this............
    >
    > Sub SubtotalColumnM()
    > Application.DisplayAlerts = False
    > Columns("M:R").Select
    > Selection.Subtotal GroupBy:=6, Function:=xlSum, TotalList:=Array(1, 6),
    > _
    > Replace:=True, PageBreaks:=False, SummaryBelowData:=True
    > Range("Q12").Select
    > Application.DisplayAlerts = True
    > End Sub
    >
    > Vaya con Dios,
    > Chuck, CABGx3
    >
    >
    > "salsal" <[email protected]> wrote in message
    > news:[email protected]...
    > > Thanks! That's good! But I need this to be written in a macro in order
    > > to use it in other workbooks.
    > >
    > > thx!
    > >
    > > CLR wrote:
    > > > Take a look at Data > Subtotals > and follow the menus........
    > > >
    > > > Vaya con Dios,
    > > > Chuck, CABGx3
    > > >
    > > >
    > > >
    > > > "salsal" wrote:
    > > >
    > > > > Hi,
    > > > >
    > > > > I need help in writing the macro to do the following:
    > > > >
    > > > > After sorting by column R, I need to insert a line between the groups,
    > > > > and then sum the total of column M for both groups (see below)
    > > > >
    > > > >
    > > > > Column M Column R
    > > > > 14.50 03COM
    > > > > 14.50 03COM
    > > > > 14.50 03COM
    > > > > 14.50 03COM
    > > > > 58.00 <-------------
    > > > > 14.50 05IT
    > > > > 14.50 05IT
    > > > > 29.00 <--------------
    > > > >
    > > > > Can you please help me?
    > > > >
    > > > > Thanks!
    > > > >
    > > > >

    > >



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1