Consulting

Results 1 to 5 of 5

Thread: Solved: Subtotals

  1. #1
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location

    Solved: Subtotals

    Not sure where to go with this one. I need to do subtotaling in a worksheet. I need to subtotal every time one column changes and then when another column changes. Is there a way to do it without the subtotal function?

    A UDF would work but not the subtotal function because I need to export it to Access and I am not sure if the function would hang on to the parse or not.

    Say I want to subtotal column A and column D how would you do that in a function? I want to export values only to Access. Thanks

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    you could replace formula's with values before you export to access:
    [VBA]'Remove all formula's from the activesheet
    Sub removeFormulas()
    With Cells
    .Select
    .Copy
    Selection.PasteSpecial Paste:=xlValues
    Application.CutCopyMode = False
    End With
    Range("A1").Select
    End Sub[/VBA]
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Thanks lucas but i have run into another unexpected problem. When i try to apply subtotals to the two columns using the Subtotal function under the Data option on the menu, the first subtotal works fine but when you apply the second subtotal using this method the first one disappears. Anyone have any ideas? Attached is a small sample of my worksheet. The subtotals should be on Account Number and Service Description Thanks.

  4. #4
    VBAX Expert Shazam's Avatar
    Joined
    Sep 2005
    Posts
    530
    Location
    Quote Originally Posted by austenr
    Thanks lucas but i have run into another unexpected problem. When i try to apply subtotals to the two columns using the Subtotal function under the Data option on the menu, the first subtotal works fine but when you apply the second subtotal using this method the first one disappears. Anyone have any ideas? Attached is a small sample of my worksheet. The subtotals should be on Account Number and Service Description Thanks.

    Hi austenr,


    When applying the second subtotal you need to uncheck:

    "Replace current subtotals"
    SHAZAM!

  5. #5
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Thanks. that got it.

Posting Permissions

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