Consulting

Results 1 to 7 of 7

Thread: Solved: modify macro to get group of data

  1. #1

    Solved: modify macro to get group of data

    i have attached excel file and in this file contain macro,then i confused how to modify it.
    in here when i input name of supplier(pusaka tani) in RESULT sheet then they will obtain some data like supplier,jenis,ukuran,kwt,quantity and price for each row that contain supplier name=pusaka tani. but in here im going to obtain data from supplier,jenis, group of ukuran,group of kwt based on each ukuran,total quantity based on ukuran and kwt,total price based on ukuran and kwt.
    hope you guys can help me to solve this problem.thanks in advance
    Attached Files Attached Files

  2. #2
    VBAX Regular
    Joined
    Nov 2011
    Location
    Ufa
    Posts
    75
    Location
    See attachment, green Arrow, Sub ertert().
    Attached Files Attached Files

  3. #3
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    hi.

    try:

    [VBA]Sub FindProductsQualityForsupplierier()

    Dim ws As Worksheet, wsFront As Worksheet
    Dim i As Long, LR As Long
    Dim supplier As String

    Application.ScreenUpdating = False

    Set wsFront = Worksheets("Result")

    With wsFront
    .Range("A5").CurrentRegion.ClearContents
    supplier = .Range("A2").Value
    .Range("A4:F4").Value = Array("Supplier", "Jenis", "Ukuran", "Kwt", "Quantity", "Price")
    End With

    If supplier = "" Then
    MsgBox "Please Enter Supplier Name", vbCritical + vbOKOnly, "W A R N I N G"
    Exit Sub
    End If

    For Each ws In Worksheets
    If ws.Name <> wsFront.Name Then
    With ws
    i = 4
    Do
    If .Cells(i, "D").Value = supplier Then
    LR = wsFront.Cells(Rows.Count, "A").End(xlUp).Row + 1
    wsFront.Range("A" & LR & ":F" & LR) = Array(.Range("D" & i), _
    .Range("I" & i), _
    .Range("K" & i), _
    .Range("M" & i), _
    .Range("R" & i), _
    .Range("S" & i))
    End If
    i = i + 1
    Loop Until .Cells(i, "D").Value = ""
    End With
    End If
    Next

    wsFront.Range("A1").Activate

    Application.ScreenUpdating = True

    End Sub
    [/VBA]
    Last edited by mancubus; 11-19-2011 at 03:28 AM.
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

  4. #4
    Quote Originally Posted by nilem
    See attachment, green Arrow, Sub ertert().
    thanks for reply.hey is it possible if then when we click blue arrow then the file will show the result from urs only?since in here i should put the the name of supplier 1st then click blue arrow then greenm arrow.

  5. #5
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    Quote Originally Posted by mancubus
    hi.

    try:

    [VBA]Sub FindProductsQualityForsupplierier()

    End Sub
    [/VBA]
    it seems i completely misunderstood the requirement, thinking it is about worksheet consolidation.
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

  6. #6
    VBAX Regular
    Joined
    Nov 2011
    Location
    Ufa
    Posts
    75
    Location
    May be this? See attachment.
    Attached Files Attached Files

  7. #7
    @mancubus its ok.heheh.btw thanks for helping me too.
    @nilem..hi nilem thanks for helping me and it work..

Posting Permissions

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