Results 1 to 4 of 4

Thread: VBA Macros

  1. #1
    Join Date
    Oct 2008
    Posts
    1

    Unanswered: VBA Macros

    Hai ,

    I am New to VB Macros . Can Anyone Help me . Please Go to the Attachment for my Requirement

    Thanks in Advance

    Kumar
    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    No need for VBA - this is nice, simple SQL.
    http://www.w3schools.com/sql/default.asp
    Check out the link, especially concentrate on GROUP BY and SUM().
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Nov 2008
    Posts
    3

    VBA Macros

    There are alot of ways to do this
    If you are looking for a way to get a total for all of the unique entries in the first column then build a unique list off to the side using something like...
    Range("A1:A7").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("D1" _
    ), Unique:=True

    then use the NindNext Method (code snippet in help) in a For Next loop to obatin the totals for all of the unique records.

    Another way is to sort the data by the first column so that all like records are next to each other. Take the first column data and set it in a varable take the second record and test to see if it is the same as the first. Add the two second column records togather. Then test the third and so on until you find a different first column data. Store the result of column 2 sum and then move on to a new column 1 data. Repete until done. Don't get discouraged. The first method is easier to do and more robust but more difficult to grasp at the beginning.

  4. #4
    Join Date
    Nov 2008
    Posts
    3

    VBA Macros

    There are alot of ways to do this
    If you are looking for a way to get a total for all of the unique entries in the first column then build a unique list off to the side using something like...
    Range("A1:A7").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("D1" _
    ), Unique:=True

    then use the FindNext Method (code snippet in help) in a For Next loop to obatin the totals for all of the unique records.

    Another way is to sort the data by the first column so that all like records are next to each other. Take the first column data and set it in a varable take the second record and test to see if it is the same as the first. Add the two second column records togather. Then test the third and so on until you find a different first column data. Store the result of column 2 sum and then move on to a new column 1 data. Repete until done. Don't get discouraged. The first method is easier to do and more robust but more difficult to grasp at the beginning.

Posting Permissions

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