Sub AA()
'
' AA Macro
' Deletes 1st 10 rows
' Creates new Sheet
' Clears cell borders
' Copies data to new Sheet
' Delete Rows, create new Sheet
Rows("1:10").Select
Selection.Delete Shift:=xlUp
Sheets.Add
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "Sheet2"
Sheets("export").Select
Sheets("export").Move Before:=Sheets(1)
Dim ws As Worksheet
Set ws = ActiveSheet
' Clear exiting borders
Cells.Borders.LineStyle = xlLineStyleNone
' Copy data to new Sheet
Dim nFound As Boolean
counter = 1: nFound = False:
idnum = "": parentfolder = "": lastrun = "": rptname = "": rptformat = ""
For a = 1 To Range("E65535").End(xlUp).Row
Cells(a, 1).Activate
If ActiveCell.Value = "SI_ID" Then
nFound = True: Cells(a, 2).Copy Sheets(2).Cells(counter, 1): idnum = Cells(a, 2)
End If
If ActiveCell.Value = "SI_NAME" Then
nFound = True: Cells(a, 2).Copy Sheets(2).Cells(counter, 2): rptname = Cells(a, 2)
End If
If ActiveCell.Value = "SI_OWNER" Then
nFound = True: Cells(a, 2).Copy Sheets(2).Cells(counter, 3)
End If
If ActiveCell.Value = "SI_PARENT_FOLDER" Then
nFound = True: Cells(a, 2).Copy Sheets(2).Cells(counter, 4): parentfolder = Cells(a, 2)
End If
If ActiveCell.Value = "SI_CREATION_TIME" Then
nFound = True: Cells(a, 2).Copy Sheets(2).Cells(counter, 5)
End If
If ActiveCell.Value = "SI_UPDATE_TS" Then
nFound = True: Cells(a, 2).Copy Sheets(2).Cells(counter, 6)
End If
If ActiveCell.Value = "SI_STARTTIME" Then
nFound = True: Cells(a, 2).Copy Sheets(2).Cells(counter, 7)
End If
If ActiveCell.Value = "SI_ENDTIME" Then
nFound = True: Cells(a, 2).Copy Sheets(2).Cells(counter, 8)
End If
If ActiveCell.Value = "SI_LAST_RUN_TIME" Then
nFound = True: Cells(a, 2).Copy Sheets(2).Cells(counter, 9): lastrun = Cells(a, 2)
End If
If ActiveCell.Value = "SI_DESCRIPTION" Then
nFound = True: Cells(a, 2).Copy Sheets(2).Cells(counter, 10)
End If
If InStr(1, Cells(a, 3).Value, "crx") <> 0 And nFound = True Then
Cells(a, 3).Copy Sheets(2).Cells(counter, 11)
End If
If ActiveCell.Value = "SI_PROGID_SCHEDULE" Then
nFound = True: Cells(a, 2).Copy Sheets(2).Cells(counter, 12): rptformat = Cells(a, 2)
End If
'If ActiveCell.Value = "SI_PERSONAL_CATEGORIES" And Cells(a, 2) <> "SI_TOTAL" Then
'nFound = True: Cells(a, 3).Copy Sheets(2).Cells(counter, 13):
'End If
'=======================================
'add each email address on separate line
'=======================================
If InStr(1, Cells(a, 5).Value, "@") <> 0 And nFound = True Then
Cells(a, 5).Copy Sheets(2).Cells(counter, 13):
'=======================================
'copy report info for each email address
'=======================================
'Sheets(2).Cells(counter, 1) = idnum:
'Sheets(2).Cells(counter, 2) = rptname:
'Sheets(2).Cells(counter, 4) = parentfolder:
'Sheets(2).Cells(counter, 9) = lastrun:
'Sheets(2).Cells(counter, 12) = rptformat:
counter = counter + 1
End If
If ActiveCell.Value = "Properties" Then nFound = False: counter = counter + 1
Next a
End Sub