Consulting

Results 1 to 8 of 8

Thread: Need help with logic

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Need help with logic

    Here's the data i have
    WX20191204-111905.jpg

    That is the code i have
    intDatRow = 1intDatCol = 1
    intRptRow = 6
    intRptCol = 2
    strAccountCategories = mergeSheet.Cells(1, 2).Value
    strQ1 = mergeSheet.Cells(1, 3).Value
    dblQ1 = 0
    
    ' Process Data
    While mergeSheet.Cells(intDatRow, 1).Value > 0
        If mergeSheet.Cells(intDatRow, 2).Value = strAccountCategories Then
            If mergeSheet.Cells(intDatRow, 3).Value = strQ1 Then
                dblQ1 = dblQ1 + mergeSheet.Cells(intDatRow, 5)
            Else
                rptSheet.Cells(intRptRow, 1).Value = dblQ1
                dblQ1 = 0
                dblQ1 = dblQ1 + mergeSheet.Cells(intDatRow, 5)
               
            End If
        Else
            rptSheet.Cells(intRptRow, 1).Value = strAccountCategories
            strAccountCategories = mergeSheet.Cells(intDatRow, 2).Value
            intRptRow = intRptRow + 1
        End If
       intDatRow = intDatRow + 1 Wend
    And i need to have my report to look like this
    Please help with my logic! i'm really struggle
    WX20191204-112245.jpg
    Attached Files Attached Files

Posting Permissions

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