none
how to convert excel VB code into power bi dax RRS feed

  • General discussion

  •     Dim dbsheet As Worksheet
        actsheet = ActiveSheet.Name
        Set dbsheet = ActiveWorkbook.Sheets(actsheet)
        lr = dbsheet.Cells(Rows.Count, 1).End(xlUp).Row

    For x = 2 To lr
      conum = dbsheet.Cells(x, 2)
        For y = 1 To lr
            If conum = dbsheet.Cells(y, 2) Then
                counter = counter + 1
            End If
        Next y
        For Z = 0 To counter - 1
            task1 = dbsheet.Cells(x + Z, 3)
            task2 = dbsheet.Cells(x + Z, 4)
            task3 = dbsheet.Cells(x + Z, 8)
            task4 = dbsheet.Cells(x + Z, 28)
            ppc1 = Left(dbsheet.Cells(x + Z, 6), 11)
            If (task1 = "Artwork Creation" Or task1 = "ARTWORK REJECTED Artwork Creation") And task3 = "Completed" Then
                sdate = dbsheet.Cells(x + Z, 9)
                ppc = dbsheet.Cells(x + Z, 7)
                If task4 = "" Then
                    Worksheets(actsheet).Cells(x + Z, 28).Value = "FTPR"
                End If
                If (dbsheet.Cells(x + Z + 1, 3) = "Artwork Studio Check") And (Left(dbsheet.Cells(x + Z + 1, 6), 11) = ppc1) Then
                    If (dbsheet.Cells(x + Z + 2, 3) = "REWORK REQUIRED") And (dbsheet.Cells(x + Z + 2, 4) = "Artwork Creation") And (Left(dbsheet.Cells(x + Z + 2, 6), 11) = ppc1) Then
                        If dbsheet.Cells(x + Z + 2, 28) = "" Then
                            Worksheets(actsheet).Cells(x + Z + 1, 28).Value = ""
                            Worksheets(actsheet).Cells(x + Z + 2, 28).Value = "REJ"
                        End If
                    End If
                    If dbsheet.Cells(x + Z + 3, 3) = "Artwork Studio Check" And (Left(dbsheet.Cells(x + Z + 3, 6), 11) = ppc1) Then
                        If (dbsheet.Cells(x + Z + 4, 3) = "REWORK REQUIRED") And (dbsheet.Cells(x + Z + 4, 4) = "Artwork Creation") And (Left(dbsheet.Cells(x + Z + 4, 6), 11) = ppc1) And dbsheet.Cells(x + Z + 4, 8) = "Completed" Then
                            If dbsheet.Cells(x + Z + 1, 28) = "" Then
                                Worksheets(actsheet).Cells(x + Z + 1, 28).Value = "PRMISS"
                                Worksheets(actsheet).Cells(x + Z + 3, 28).Value = ""
                            End If
                        End If
                    End If
                End If
                If (dbsheet.Cells(x + Z + 1, 3) = "REWORK REQUIRED" And dbsheet.Cells(x + Z + 1, 4) = "Brief Submission") And dbsheet.Cells(x + Z + 1, 7) = ppc And dbsheet.Cells(x + Z, 28) <> "Brief Rej" Then
                    Worksheets(actsheet).Cells(x + Z, 28).Value = "Brief Rej"
                End If
            End If
        Next Z
        x = x + counter - 1
        counter = 0
    Next x
    Thursday, February 6, 2020 4:20 PM