You are on page 1of 31

Sub Semaforos_1()

'
' Semaforos_1 Macro
'

'

    Application.ScreenUpdating = False

    Columns("C:C").Select
    Selection.TextToColumns Destination:=Range("C1"), DataType:=xlDelimited, _
        TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
        Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
        :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6,
1), _
       Array(7, 1), Array(8, 1), Array(9, 1)), DecimalSeparator:=".",
ThousandsSeparator _
        :=",", TrailingMinusNumbers:=True
   
    Columns("k:q").Select
    Selection.Delete Shift:=xlToLeft
    Columns("c:c").Select
    Selection.Delete Shift:=xlToLeft
   
    
    Columns("i:i").Select
        Selection.TextToColumns Destination:=Range("I1"), DataType:=xlDelimited, _
        TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
        Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
        :=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6,
1), _
        Array(7, 1), Array(8, 1), Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1),
Array(13, 1 _
        ), Array(14, 1), Array(15, 1), Array(16, 1), Array(17, 1), Array(18, 1), Array(19,
1), Array _
        (20, 1)), TrailingMinusNumbers:=True
        
    Range("H1").Select
    Range(Selection, Selection.End(xlToRight)).Select
    Columns("j:XFD").Select
    Selection.Delete Shift:=xlToLeft
    Columns("i:i").Select
    Selection.Replace What:=" ", Replacement:="", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False
       
    Columns("h:h").Select
    Selection.Replace What:=".", Replacement:=",", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False
       
    Columns("H:H").Select
    Selection.TextToColumns Destination:=Range("H1"), DataType:=xlDelimited, _
        TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
        Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
        :=Array(1, 1), TrailingMinusNumbers:=True
    Range("j1").Select
    ActiveCell.FormulaR1C1 = "x"
    Range("j2").Select
    ActiveCell.FormulaR1C1 = "=+IF(RC[-2]=0,0,1)"
    Range("i1000000").Select
    Selection.End(xlUp).Select
    ActiveCell.Offset(0, 1).Select
    Range(Selection, Selection.End(xlUp)).Select
    Selection.FillDown
    Columns("j:j").Select
    Selection.Copy
   Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Application.CutCopyMode = False
   
    Range("a1").Select

' ordena y elimina los duplicados '

ActiveWorkbook.Worksheets("Learning_Population_Reconcileme").Sort.SortFields
._
        Clear
   
ActiveWorkbook.Worksheets("Learning_Population_Reconcileme").Sort.SortFields
._
        Add Key:=Range("A2:A50000"), SortOn:=xlSortOnValues,
Order:=xlAscending, _
        DataOption:=xlSortNormal
   
ActiveWorkbook.Worksheets("Learning_Population_Reconcileme").Sort.SortFields
._
        Add Key:=Range("B2:B50000"), SortOn:=xlSortOnValues,
Order:=xlAscending, _
        DataOption:=xlSortNormal
   
ActiveWorkbook.Worksheets("Learning_Population_Reconcileme").Sort.SortFields
._
        Add Key:=Range("D2:D50000"), SortOn:=xlSortOnValues,
Order:=xlAscending, _
        DataOption:=xlSortNormal
   
ActiveWorkbook.Worksheets("Learning_Population_Reconcileme").Sort.SortFields
._
        Add Key:=Range("J2:J50000"), SortOn:=xlSortOnValues,
Order:=xlDescending, _
        DataOption:=xlSortNormal
   
ActiveWorkbook.Worksheets("Learning_Population_Reconcileme").Sort.SortFields
._
        Add Key:=Range("I2:I50000"), SortOn:=xlSortOnValues,
Order:=xlDescending, _
        DataOption:=xlSortNormal
   
ActiveWorkbook.Worksheets("Learning_Population_Reconcileme").Sort.SortFields
._
        Add Key:=Range("F2:F50000"), SortOn:=xlSortOnValues,
Order:=xlDescending, _
        DataOption:=xlSortNormal
    With ActiveWorkbook.Worksheets("Learning_Population_Reconcileme").Sort
        .SetRange Range("A1:J50000")
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
    ActiveSheet.Range("$A$1:$J$50000").RemoveDuplicates Columns:=Array(1, 2,
4, 5), _
        Header:=xlYes
    Range("I1").Select
    Selection.AutoFilter
    Columns("J:J").Select
    Selection.Delete Shift:=xlToLeft
   
    Range("J2").Select
        ActiveCell.FormulaR1C1 = "=+IF(RC[-1]=0,RC[-4],RC[-1])"
    Range("J1").Select
    ActiveCell.FormulaR1C1 = "Attendance"
    Range("h1000000").Select
    Selection.End(xlUp).Select
    ActiveCell.Offset(0, 2).Select
    Range(Selection, Selection.End(xlUp)).Select
    Selection.FillDown
    Selection.End(xlUp).Select
    Columns("J:J").Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    
    
    ' -------------------------------------------------'
        Range("L2").Select
    ActiveCell.FormulaR1C1 = _
        "=+IF(COUNTIFS(C[-8],)=COUNTIFS(C[-8],RC[-8],C[-3],"">""&0),""Grupo sin
asistencia"",IF(RC[-3]=0,RC[-6],RC[-3]))"
    Range("L2").Select
    Selection.Copy
    Range("j1000000").Select
    Selection.End(xlUp).Select
    ActiveCell.Offset(0, 2).Select
    Range(Selection, Selection.End(xlUp)).Select
    Selection.FillDown
    Selection.End(xlUp).Select
            
    
    Range("L1").Select
    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = "otro"
    Columns("L:L").Select
    Range("L2").Activate
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Range("J2").Select
    Application.CutCopyMode = False
   
     ' -------------------------------------------------'
    
    
    
    Range("J2").Select
8    Application.CutCopyMode = False
    Columns("I:I").Select
    Range("I2").Activate
    Selection.Delete Shift:=xlToLeft
    Columns("I:I").Select
    Range("I3").Activate
    Selection.NumberFormat = "m/d/yyyy"
    Range("I3").Select
   
    
    ' elegir revision de estudiantes '
   
    Range("L1").Select
    ActiveCell.FormulaR1C1 = "=+TODAY()-15"
    Range("J1").Select
    ActiveCell.FormulaR1C1 = "Revisar"
    Range("J2").Select
    ActiveCell.FormulaR1C1 = _
        "=+IF(RC[1]=""Grupo sin asistencia"",""Revisar"",IF(RC[-
1]<R1C12,""Revisar"",""ok""))"
   Range("J3").Select
    Selection.End(xlDown).Select
    Range("I1000000").Select
    Selection.End(xlUp).Select
   ActiveCell.Offset(0, 1).Select
    Range(Selection, Selection.End(xlUp)).Select
    Selection.FillDown
    ActiveCell.Offset(0, 1).Select
    Selection.End(xlUp).Select
    Columns("J:J").Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Range("J2").Select
    Application.CutCopyMode = False
    Range("J1").Select
    Selection.AutoFilter
    Selection.AutoFilter
   
ActiveWorkbook.Worksheets("Learning_Population_Reconcileme").AutoFilter.Sort.
_
        SortFields.Clear
   
ActiveWorkbook.Worksheets("Learning_Population_Reconcileme").AutoFilter.Sort.
_
        SortFields.Add Key:=Range("J1:J42777"), SortOn:=xlSortOnValues, Order:=
_
        xlDescending, DataOption:=xlSortNormal
    With
ActiveWorkbook.Worksheets("Learning_Population_Reconcileme").AutoFilter. _
        Sort
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
    Range("J2").Select
   
    

   
    ' sdjfbsdkjbjsdkf '
       
        Columns("K:K").Select
    Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
   
    
       Range("L1").Select
    Selection.ClearContents
    Range("M1").Select
    ActiveCell.FormulaR1C1 = "=+TODAY()"
    Range("K2").Select
    ActiveCell.FormulaR1C1 = "=+IF(RC[-2]>R1C13,""elim"",""ok"")"
    Range("K3").Select
    Selection.End(xlDown).Select
    Range("J1000000").Select
    Selection.End(xlUp).Select
    ActiveCell.Offset(0, 1).Select
    Range(Selection, Selection.End(xlUp)).Select
    Selection.FillDown
    ActiveCell.Offset(0, 1).Select
    Selection.End(xlUp).Select
    Range("K1").Select
    ActiveCell.FormulaR1C1 = "x"
    Columns("K:K").Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Range("K1").Select
    Selection.AutoFilter
    Selection.AutoFilter
    Range("D1").Select
    ActiveSheet.Range("$A$1:$K$89888").AutoFilter Field:=4, Criteria1:= _
        "=*retirado*", Operator:=xlAnd
    Columns("K:K").Select
    Selection.Replace What:="ok", Replacement:="elim", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False
    Range("J1").Select
    Selection.AutoFilter
    Selection.AutoFilter
   
    
    
    Application.CutCopyMode = False
    Range("K2").Select
    Selection.Copy
    Columns("K:K").Select
    Selection.Replace What:="ok", Replacement:="", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False
    Range("K1").Select
    Application.CutCopyMode = False
    Selection.AutoFilter
    Selection.AutoFilter
   
ActiveWorkbook.Worksheets("Learning_Population_Reconcileme").AutoFilter.Sort.
_
        SortFields.Clear
   
ActiveWorkbook.Worksheets("Learning_Population_Reconcileme").AutoFilter.Sort.
_
        SortFields.Add Key:=Range("K1:K42777"), SortOn:=xlSortOnValues, Order:=
_
        xlDescending, DataOption:=xlSortNormal
    With
ActiveWorkbook.Worksheets("Learning_Population_Reconcileme").AutoFilter. _
        Sort
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
   
    
  
    
    
    Range("k1000000").Select
    Selection.End(xlUp).Select
    Selection.EntireRow.Select
    Range(Selection, Selection.End(xlUp)).Select
    Selection.Delete Shift:=xlUp
    Rows("1:1").Select
    Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
    Range("A1").Select
    ActiveCell.FormulaR1C1 = "Pais"
    Range("B1").Select
    ActiveCell.FormulaR1C1 = "Sede"
    Range("C1").Select
    ActiveCell.FormulaR1C1 = "LessonTypeID"
    Range("d1").Select
    ActiveCell.FormulaR1C1 = "GroupName"
    Range("e1").Select
    ActiveCell.FormulaR1C1 = "CustomerName"
    Range("f1").Select
    ActiveCell.FormulaR1C1 = "StartDate"
    Range("g1").Select
    ActiveCell.FormulaR1C1 = "EndDate"
    Range("h1").Select
    ActiveCell.FormulaR1C1 = "LessonRate"
    Range("i1").Select
    ActiveCell.FormulaR1C1 = "Attendance"
    Range("j1").Select
    ActiveCell.FormulaR1C1 = "Revisar"
   
      
    Columns("K:K").Select
    Selection.Delete Shift:=xlToLeft
    Range("k1").Select
    ActiveCell.FormulaR1C1 = "otro"
               
    Columns("J:J").Select
    Selection.Replace What:="ok", Replacement:="", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False
        
        
        Range("K1").Select
    ActiveCell.FormulaR1C1 = "Attendance"
    Columns("K:K").Select
    Selection.NumberFormat = "m/d/yyyy"
    Columns("I:I").Select
    Selection.ClearContents
    Columns("K:K").Select
    Selection.Copy
    Columns("I:I").Select
    ActiveSheet.Paste
    Range("J3").Select
    Application.CutCopyMode = False
    Columns("K:K").Select
    Selection.ClearContents
    Range("J6").Select
       
        
        
        
        
    Range("J1").Select
    Selection.AutoFilter
   
ActiveWorkbook.Worksheets("Learning_Population_Reconcileme").AutoFilter.Sort.
_
        SortFields.Clear
   
ActiveWorkbook.Worksheets("Learning_Population_Reconcileme").AutoFilter.Sort.
_
        SortFields.Add Key:=Range("J1:J424"), SortOn:=xlSortOnValues, Order:= _
        xlDescending, DataOption:=xlSortNormal
    With
ActiveWorkbook.Worksheets("Learning_Population_Reconcileme").AutoFilter. _
        Sort
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
   
    Range("j1000000").Select
    Selection.End(xlUp).Select
    Selection.EntireRow.Select
    Range(Selection, Selection.End(xlUp)).Select
    Selection.Copy
   
    ' comienza a crear hojas de estudiantes y grupos '
   
    Sheets.Add After:=Sheets(Sheets.Count)
    ActiveSheet.Paste
    Sheets("Hoja1").Select
    Sheets("Hoja1").Name = "Notificar Estado De Estudiantes"
    Range("J2").Select
    Columns("j:k").Select
    Selection.Delete Shift:=xlToLeft
    Application.CutCopyMode = False
    ActiveCell.FormulaR1C1 = _
        "=+IF(COUNTIF(C[-6],RC[-6])=COUNTIF(Learning_Population_Reconcileme!
C[-6],RC[-6]),""Grupos"",""Estudiantes"")"
  
    Range("I1000000").Select
    Selection.End(xlUp).Select
    ActiveCell.Offset(0, 1).Select
    Range(Selection, Selection.End(xlUp)).Select
    Selection.FillDown
    Columns("J:J").Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Range("K12").Select
    Application.CutCopyMode = False
    Columns("J:J").Select
    Selection.Replace What:="estudiantes", Replacement:="", LookAt:=xlPart, _
        SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
        ReplaceFormat:=False
    Range("j1").Select
    ActiveCell.FormulaR1C1 = "Estudiantes"
    Range("J1").Select
    Selection.AutoFilter
   
       ActiveWorkbook.Worksheets("Notificar Estado De
Estudiantes").AutoFilter.Sort. _
        SortFields.Clear
    ActiveWorkbook.Worksheets("Notificar Estado De Estudiantes").AutoFilter.Sort.
_
        SortFields.Add Key:=Range("J1:J102000"), SortOn:=xlSortOnValues, Order:=
_
        xlDescending, DataOption:=xlSortNormal
    With ActiveWorkbook.Worksheets("Notificar Estado De Estudiantes").AutoFilter.
_
        Sort
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
       .SortMethod = xlPinYin
        .Apply
    End With
   
    Range("j1000000").Select
    Selection.End(xlUp).Select
    Selection.EntireRow.Select
    Range(Selection, Selection.End(xlUp)).Select
    Selection.Copy
   
    Sheets.Add After:=Sheets(Sheets.Count)
    ActiveSheet.Paste
    Sheets("Hoja2").Select
    Sheets("Hoja2").Name = "Notificar Estado de Grupos"
    Cells.Select
    Application.CutCopyMode = False
    ActiveSheet.Range("$A$1:$AB$9100").RemoveDuplicates Columns:=4,
Header:=xlNo
    Columns("E:E").Select
    Selection.Delete Shift:=xlToLeft
    Columns("E:F").Select
    Selection.Delete Shift:=xlToLeft
    Columns("E:E").Select
    Selection.Delete Shift:=xlToLeft
    Range("F1").Select
    Sheets("Notificar Estado De Estudiantes").Select
    Selection.Delete Shift:=xlUp
    Rows("1:1").Select
    Selection.Insert Shift:=xlDown
    Range("A1").Select
    ActiveCell.FormulaR1C1 = "Pais"
    Range("B1").Select
    ActiveCell.FormulaR1C1 = "Sede"
    Range("C1").Select
    ActiveCell.FormulaR1C1 = "LessonTypeID"
    Range("d1").Select
    ActiveCell.FormulaR1C1 = "GroupName"
    Range("e1").Select
    ActiveCell.FormulaR1C1 = "CustomerName"
    Range("f1").Select
    ActiveCell.FormulaR1C1 = "StartDate"
    Range("g1").Select
    ActiveCell.FormulaR1C1 = "EndDate"
    Range("h1").Select
    ActiveCell.FormulaR1C1 = "LessonRate"
    Range("i1").Select
    ActiveCell.FormulaR1C1 = "Attendance"
    Range("j1").Select
    ActiveCell.FormulaR1C1 = "Revisar"
   
    ' Coloreando '
       
        Columns("F:H").Select
    Selection.Delete Shift:=xlToLeft

    Range("F1").Select
    ActiveCell.FormulaR1C1 = "Ultima asistencia Berlitz"
    Range("G1").Select

    ActiveCell.FormulaR1C1 = "Novedad SSC"


    Range("H1").Select

    ActiveCell.FormulaR1C1 = "Aclaración de Sede"


    ActiveCell.FormulaR1C1 = "Aclaración de Sede, proceso a seguir"
    Range("H2").Select
    Columns("A:A").ColumnWidth = 10.29
    Columns("B:B").ColumnWidth = 27.86
    Columns("B:B").ColumnWidth = 26.29
    Columns("B:B").ColumnWidth = 24
    Columns("C:C").ColumnWidth = 14.86
    Columns("D:D").ColumnWidth = 30.14
    Columns("E:E").ColumnWidth = 26.14
    Columns("E:E").ColumnWidth = 43.71
    Columns("D:D").ColumnWidth = 22.43
    Columns("E:E").ColumnWidth = 48.86
    Columns("F:F").ColumnWidth = 14.57
    Columns("F:F").ColumnWidth = 19.29
    Columns("F:F").ColumnWidth = 23.71
    Columns("G:G").ColumnWidth = 22.57
    Columns("G:G").ColumnWidth = 36.57
    Columns("H:H").ColumnWidth = 32.86
    Sheets("Notificar Estado de Grupos").Select
    Columns("A:A").ColumnWidth = 9.71
    Columns("B:B").ColumnWidth = 32.57
    Columns("B:B").ColumnWidth = 22.71
    Columns("C:C").ColumnWidth = 14.71
    Columns("D:D").ColumnWidth = 30.43
    Columns("D:D").ColumnWidth = 32.29
    Range("E1").Select
    ActiveCell.FormulaR1C1 = "Ultima Asistencia Berlitz"
    Range("E4").Select
    Columns("E:E").ColumnWidth = 30.86
    Columns("E:E").ColumnWidth = 32.43
    Columns("E:E").ColumnWidth = 22.57
   
    Range("F1").Select
    ActiveCell.FormulaR1C1 = "Novedad SSC"
    Range("F3").Select
    Columns("F:F").ColumnWidth = 25.43
    Range("F1").Select
    Columns("F:F").ColumnWidth = 21
    Range("G1").Select
    ActiveCell.FormulaR1C1 = "Aclaracion Sede"
    Range("F5").Select
    Columns("G:G").ColumnWidth = 52.43
    Columns("G:G").ColumnWidth = 35.43
    Sheets("Learning_Population_Reconcileme").Select
    Sheets("Learning_Population_Reconcileme").Name = _
        "Learning_Population_Reconcileme"
    Sheets("Learning_Population_Reconcileme").Select
    Sheets("Learning_Population_Reconcileme").Name = "BD"
    Range("A1").Select
    Columns("B:B").ColumnWidth = 24.29
    Columns("B:B").ColumnWidth = 23.57
    Columns("C:C").ColumnWidth = 24.29
    Columns("C:C").ColumnWidth = 21.29
    Columns("D:D").ColumnWidth = 21.29
    Columns("C:C").ColumnWidth = 17.14
    Columns("C:C").ColumnWidth = 13.57
    Columns("C:C").ColumnWidth = 15.57
    Columns("D:D").ColumnWidth = 26.14
    Columns("E:E").ColumnWidth = 29.71
    Columns("E:E").ColumnWidth = 38.71
    Columns("E:E").ColumnWidth = 44.57
    Columns("E:E").ColumnWidth = 46.57
    ActiveWindow.Zoom = 85
    Columns("F:H").Select
    Selection.Delete Shift:=xlToLeft
    Range("F1").Select
    ActiveCell.FormulaR1C1 = "Ultima Asistencia"
    Range("F3").Select
    Columns("F:F").ColumnWidth = 19.14
    Columns("F:F").ColumnWidth = 20
    Range("H28").Select
    Selection.End(xlDown).Select
    Range("e1000000").Select
    Selection.End(xlUp).Select
   
    
    
    Selection.EntireRow.Select
    Range(Selection, Selection.End(xlUp)).Select

    Selection.Borders(xlDiagonalDown).LineStyle = xlNone


    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlInsideVertical)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
   With Selection.Borders(xlInsideHorizontal)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Font
        .Name = "Calibri"
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .TintAndShade = 0
        .ThemeFont = xlThemeFontMinor
    End With
    With Selection.Font
        .Name = "Calibri"
        .Size = 11
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .TintAndShade = 0
        .ThemeFont = xlThemeFontMinor
    End With

    Range("g1000000").Select
    Selection.End(xlUp).Select
    Selection.EntireRow.Select
    Range(Selection, Selection.End(xlUp)).Select

       
    'Color de estudiantes a Revisar'
        Selection.Style = "Incorrecto"

   
    Range("g1000000").Select
    Selection.End(xlUp).Select
    Selection.EntireRow.Select
    Range(Selection, Selection.End(xlUp)).Select

    Selection.Copy
    Range(Selection, Selection.End(xlUp)).Select
    Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
    ActiveWindow.SmallScroll Down:=-69
    Range("G48").Select
    Selection.End(xlUp).Select
    Rows("1:1").Select
    Application.CutCopyMode = False
   
    
    'Color de titulos hoja BD'

   
    
    
    
    
    Columns("F:F").Select
    With Selection
        .HorizontalAlignment = xlGeneral
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    With Selection
        .HorizontalAlignment = xlCenter
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    With Selection
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    With Selection
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    Columns("A:D").Select
    Range("D1").Activate
    With Selection
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    With Selection
        .VerticalAlignment = xlCenter
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    With Selection
        .HorizontalAlignment = xlGeneral
        .VerticalAlignment = xlCenter
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    With Selection
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
   
    ' 2 parte poniendo solores '
       
    
     Columns("G:G").Select
    Selection.Delete Shift:=xlToLeft
    Range("D6").Select
    ActiveWorkbook.Worksheets("BD").AutoFilter.Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("BD").AutoFilter.Sort.SortFields.Add
Key:=Range( _
        "D2:D102800"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=
_
        xlSortNormal
    ActiveWorkbook.Worksheets("BD").AutoFilter.Sort.SortFields.Add
Key:=Range( _
        "F2:F102800"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=
_
        xlSortNormal
    With ActiveWorkbook.Worksheets("BD").AutoFilter.Sort
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
    Range("D7").Select
    Selection.Subtotal GroupBy:=4, Function:=xlCount, TotalList:=Array(2, 6), _
        Replace:=True, PageBreaks:=False, SummaryBelowData:=True
    Range("D1").Select
    ActiveSheet.Range("$A$1:$F$121100").AutoFilter Field:=4, Criteria1:= _
        "=*cuenta*", Operator:=xlAnd

    Range("D1000000").Select
    Selection.End(xlUp).Select
   
    Selection.EntireRow.Select
    Selection.Delete
    Range("D1000000").Select
    Selection.End(xlUp).Select
   
    Selection.EntireRow.Select
   
    Range(Selection, Selection.End(xlUp)).Select
   
    
    
    'color de los subtitulos'
         With Selection.Interior
        .Pattern = x1Solid
        .PatternColorIndex = xlAutomatic
        .ThemeColor = xlThemeColorAccent5
        .TintAndShade = -0.249977111117893
        .PatternTintAndShade = 0
    End With
    With Selection.Font
        .ThemeColor = xlThemeColorDark1
        .TintAndShade = 0
    End With
    Selection.Font.Bold = False
    Selection.Font.Bold = True
    Range("D1112").Select
    Selection.End(xlUp).Select
    Selection.AutoFilter
    Columns("G:G").Select
    Range(Selection, Selection.End(xlToRight)).Select
    With Selection.Interior
        .Pattern = xlNone
        .TintAndShade = 0
        .PatternTintAndShade = 0
    End With
    With Selection.Font
        .ColorIndex = xlAutomatic
        .TintAndShade = 0
    End With
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    Selection.Borders(xlEdgeLeft).LineStyle = xlNone
    Selection.Borders(xlEdgeTop).LineStyle = xlNone
    Selection.Borders(xlEdgeBottom).LineStyle = xlNone
    Selection.Borders(xlEdgeRight).LineStyle = xlNone
    Selection.Borders(xlInsideVertical).LineStyle = xlNone
    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
    Selection.Delete Shift:=xlToLeft
    Range("B6").Select
    ActiveWorkbook.Save
       
        Range("A1:F1").Select
    Range("F1").Activate
    With Selection.Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        .ThemeColor = xlThemeColorLight2
        .TintAndShade = -0.499984740745262
        .PatternTintAndShade = 0
    End With
    Range("A1:F1").Select
    Range("F1").Activate
    With Selection.Font
        .ThemeColor = xlThemeColorDark1
        .TintAndShade = 0
    End With
    Range("D4").Select
   
    
    
    Sheets("Notificar Estado De Estudiantes").Select
    Range("A1:H1").Select
    Range("H1").Activate
    With Selection.Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        .ThemeColor = xlThemeColorLight2
        .TintAndShade = -0.499984740745262
        .PatternTintAndShade = 0
    End With
    With Selection.Font
        .ThemeColor = xlThemeColorDark1
       .TintAndShade = 0
    End With
    Range("B4").Select
    ActiveWindow.Zoom = 85
   
       
    Rows("2:2").Select
    Selection.Insert Shift:=xlDown
    Range("A2").Select
    ActiveCell.FormulaR1C1 = "x"
    Range("B2").Select
    ActiveCell.FormulaR1C1 = "x"
    Range("C2").Select
    ActiveCell.FormulaR1C1 = "x"
    Range("D2").Select
    ActiveCell.FormulaR1C1 = "x"
    Range("E2").Select
    ActiveCell.FormulaR1C1 = "x"
    Range("F2").Select
    ActiveCell.FormulaR1C1 = "x"
    Range("G2").Select
    ActiveCell.FormulaR1C1 = "x"
    Range("H2").Select
    ActiveCell.FormulaR1C1 = "x"
    Rows("2:2").Select
   
    
    
    Range("c1000000").Select
    Selection.End(xlUp).Select
    Selection.EntireRow.Select
    Range(Selection, Selection.End(xlUp)).Select
   
    
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
       .Weight = xlThin
    End With
    With Selection.Borders(xlInsideVertical)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlInsideHorizontal)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    Columns("I:I").Select
    Range(Selection, Selection.End(xlToRight)).Select
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    Selection.Borders(xlEdgeLeft).LineStyle = xlNone
    Selection.Borders(xlEdgeTop).LineStyle = xlNone
    Selection.Borders(xlEdgeBottom).LineStyle = xlNone
    Selection.Borders(xlEdgeRight).LineStyle = xlNone
    Selection.Borders(xlInsideVertical).LineStyle = xlNone
    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
    Rows("1:1").Select
    With Selection
        .HorizontalAlignment = xlGeneral
        .VerticalAlignment = xlCenter
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    With Selection
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    Range("E4").Select
    Columns("H:H").ColumnWidth = 41.14
    Range("G2").Select
   
                        
    ActiveCell.FormulaR1C1 = "Ultima Asistencia Positiva del Estudiante a Berlitz"
    With Selection.Interior
        .Pattern = xlNone
        .TintAndShade = 0
        .PatternTintAndShade = 0
    End With
    With Selection.Font
        .ColorIndex = xlAutomatic
        .TintAndShade = 0
    End With
   
    
        
    Range("f1000000").Select
    Selection.End(xlUp).Select
    ActiveCell.Offset(0, 1).Select
    Range(Selection, Selection.End(xlUp)).Select
    Selection.FillDown
   
    Rows("2:2").Select
    Selection.Delete Shift:=xlUp
   
    
   ' xxxxxxxxxxxxxxxxxxxxxxxxxxxx '
       Sheets("Notificar Estado De Estudiantes").Select
    Range("G2").Select
    ActiveCell.FormulaR1C1 = "Ultima Asistencia Positiva del Estudiante a Berlitz"
    Range("G2").Select
    With Selection.Interior
        .Pattern = xlNone
        .TintAndShade = 0
        .PatternTintAndShade = 0
    End With
    With Selection.Font
        .ColorIndex = xlAutomatic
        .TintAndShade = 0
    End With
   
    
    
    Sheets("Notificar Estado de Grupos").Select
    ActiveWindow.Zoom = 85
    ActiveWindow.SmallScroll Down:=-9
    Rows("1:1").Select
    Range("E1").Activate
    With Selection.Interior
        .Pattern = xlSolid
        .PatternColorIndex = xlAutomatic
        .ThemeColor = xlThemeColorLight2
        .TintAndShade = -0.499984740745262
        .PatternTintAndShade = 0
    End With
    With Selection.Font
        .ThemeColor = xlThemeColorDark1
        .TintAndShade = 0
    End With
    With Selection
        .HorizontalAlignment = xlGeneral
        .VerticalAlignment = xlCenter
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    With Selection
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
       
    Range("c1000000").Select
    Selection.End(xlUp).Select
    Selection.EntireRow.Select
    Range(Selection, Selection.End(xlUp)).Select
       
        
        Range(Selection, Selection.End(xlUp)).Select
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlInsideVertical)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlInsideHorizontal)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
   Columns("H:H").Select
    Range(Selection, Selection.End(xlToRight)).Select
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    Selection.Borders(xlEdgeLeft).LineStyle = xlNone
    Selection.Borders(xlEdgeTop).LineStyle = xlNone
    Selection.Borders(xlEdgeBottom).LineStyle = xlNone
    Selection.Borders(xlEdgeRight).LineStyle = xlNone
    Selection.Borders(xlInsideVertical).LineStyle = xlNone
    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
    With Selection.Interior
        .Pattern = xlNone
        .TintAndShade = 0
        .PatternTintAndShade = 0
    End With
    Columns("F:F").Select
    Selection.Replace What:="Grupos", Replacement:="Grupo sin Programacion en
PedCard", LookAt _
        :=xlPart, SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False,
_
        ReplaceFormat:=False
 
    
    
    Sheets("Notificar Estado de Estudiantes").Select
    Range("a1").Select
    Columns("A:A").ColumnWidth = 12.57
    Columns("B:B").ColumnWidth = 23.86
    Columns("C:C").ColumnWidth = 15
    Columns("D:D").ColumnWidth = 40.14
    Columns("E:E").ColumnWidth = 46.86
    Columns("F:F").ColumnWidth = 24.71
    Columns("G:G").ColumnWidth = 47.71
    Columns("H:H").ColumnWidth = 43.71
   
    Sheets("Notificar Estado de Grupos").Select
    Range("a1").Select
    Columns("A:A").ColumnWidth = 12.86
    Columns("B:B").ColumnWidth = 22.57
    Columns("C:C").ColumnWidth = 15.43
    Columns("D:D").ColumnWidth = 43.71
    Columns("E:E").ColumnWidth = 23.29
    Columns("F:F").ColumnWidth = 34.29
    Columns("G:G").ColumnWidth = 51.57

   
       Sheets.Add After:=Sheets(Sheets.Count)
   
    Range("A1").Select
    ActiveCell.FormulaR1C1 = "CH"
    Range("A2").Select
    ActiveCell.FormulaR1C1 = "G1"
    Range("A3").Select
    ActiveCell.FormulaR1C1 = "G1S"
    Range("A4").Select
    ActiveCell.FormulaR1C1 = "G3"
    Range("A5").Select
    ActiveCell.FormulaR1C1 = "P2"
    Range("A6").Select
    ActiveCell.FormulaR1C1 = "SP+"
    Range("A7").Select
    ActiveCell.FormulaR1C1 = "ARC"
    Range("A8").Select
    ActiveCell.FormulaR1C1 = "GIB"
    Range("A9").Select
    ActiveCell.FormulaR1C1 = "ENP"
    Range("A10").Select
    ActiveCell.FormulaR1C1 = "G2"
    Range("A11").Select
    ActiveCell.FormulaR1C1 = "STA"
    Range("A12").Select
    ActiveCell.FormulaR1C1 = "ECR"
    Range("A13").Select
    ActiveCell.FormulaR1C1 = "EMV"
    Range("A14").Select
    ActiveCell.FormulaR1C1 = "BTRLS"
    Range("A15").Select
    ActiveCell.FormulaR1C1 = "CTI"
    Range("A16").Select
    ActiveCell.FormulaR1C1 = "ESF"
    Range("A17").Select
    ActiveCell.FormulaR1C1 = "ESM"
    Range("A18").Select
    ActiveCell.FormulaR1C1 = "IP"
    Range("A19").Select
    ActiveCell.FormulaR1C1 = "ITI"
    Range("A20").Select
    ActiveCell.FormulaR1C1 = "KID"
    Range("A21").Select
    ActiveCell.FormulaR1C1 = "KIDS"
    Range("A22").Select
    ActiveCell.FormulaR1C1 = "P"
    Range("A23").Select
    ActiveCell.FormulaR1C1 = "P1S"
    Range("A24").Select
    ActiveCell.FormulaR1C1 = "PC"
    Range("A25").Select
    ActiveCell.FormulaR1C1 = "PCP"
    Range("A26").Select
    ActiveCell.FormulaR1C1 = "PIP"
    Range("A27").Select
    ActiveCell.FormulaR1C1 = "TI"
    Range("A28").Select
    ActiveCell.FormulaR1C1 = "TSC"
    Range("A29").Select
    ActiveCell.FormulaR1C1 = "TST"
    Range("A30").Select
    ActiveCell.FormulaR1C1 = "VP1"
    Range("B1").Select
    ActiveCell.FormulaR1C1 = "N/A"
    Range("B2").Select
    ActiveCell.FormulaR1C1 = "4"
    Range("B3").Select
    ActiveCell.FormulaR1C1 = "4"
    Range("B4").Select
    ActiveCell.FormulaR1C1 = "5"
    Range("B5").Select
    ActiveCell.FormulaR1C1 = "2"
    Range("B6").Select
    ActiveCell.FormulaR1C1 = "3"
    Range("B7").Select
    ActiveCell.FormulaR1C1 = "N/A"
    Range("B8").Select
    ActiveCell.FormulaR1C1 = "N/A"
    Range("B9").Select
    ActiveCell.FormulaR1C1 = "N/A"
    Range("B10").Select
    ActiveCell.FormulaR1C1 = "4"
    Range("B11").Select
    ActiveCell.FormulaR1C1 = "4"
    Range("B12").Select
    ActiveCell.FormulaR1C1 = "N/A"
    Range("B13").Select
   ActiveCell.FormulaR1C1 = "N/A"
    Range("B14").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B15").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B16").Select
    ActiveCell.FormulaR1C1 = "N/A"
    Range("B17").Select
    ActiveCell.FormulaR1C1 = "N/A"
    Range("B18").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B19").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B20").Select
    ActiveCell.FormulaR1C1 = "5"
    Range("B21").Select
    ActiveCell.FormulaR1C1 = "5"
    Range("B22").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B23").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B24").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B25").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B26").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B27").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B28").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B29").Select
    ActiveCell.FormulaR1C1 = "1"
    Range("B30").Select
    ActiveCell.FormulaR1C1 = "1"
   
    
    Range("A31").Select
    ActiveCell.FormulaR1C1 = "VCH"
    Range("B31").Select
    ActiveCell.FormulaR1C1 = "N/A"
   
    Range("A32").Select
    ActiveCell.FormulaR1C1 = "DUI"
    Range("B32").Select
    ActiveCell.FormulaR1C1 = "2"
       
    Range("A33").Select
    ActiveCell.FormulaR1C1 = "DUC"
    Range("B33").Select
    ActiveCell.FormulaR1C1 = "2"
   
    Range("A34").Select
    ActiveCell.FormulaR1C1 = "CHB"
    Range("B34").Select
    ActiveCell.FormulaR1C1 = "N/A"
       
    Range("A35").Select
    ActiveCell.FormulaR1C1 = "G1B"
    Range("B35").Select
    ActiveCell.FormulaR1C1 = "N/A"
   
    Range("A36").Select
    ActiveCell.FormulaR1C1 = "VDU"
    Range("B36").Select
    ActiveCell.FormulaR1C1 = "2"
   
    Range("A37").Select
    ActiveCell.FormulaR1C1 = "DCP"
    Range("B37").Select
    ActiveCell.FormulaR1C1 = "2"
   
    Range("A38").Select
    ActiveCell.FormulaR1C1 = "DIP"
    Range("B38").Select
    ActiveCell.FormulaR1C1 = "2"
   
    
    Range("A39").Select
    ActiveCell.FormulaR1C1 = "KTG"
    Range("B39").Select
    ActiveCell.FormulaR1C1 = "5"
   
    
    Sheets("Hoja3").Select
    ActiveWindow.SelectedSheets.Visible = False
       
    Sheets("BD").Select
    Range("G1").Select
    ActiveCell.FormulaR1C1 = "Población"
    Range("G2").Select
    ActiveCell.FormulaR1C1 = _
        "=+IF(RC[-4]="""","""",IFERROR(IF(VLOOKUP(RC[-4],Hoja3!C[-6]:C[-
5],2,0)=""N/a"",""No aplica"",IF(VLOOKUP(RC[-4],Hoja3!C[-6]:C[-
5],2,0)>(COUNTIFS(C[-4],RC[-4],C[-3],RC[-3])),""Baja población"",""Población
ok"")),""Revisar tipo de leccion""))"
    Range("F1000000").Select
    Selection.End(xlUp).Select
    ActiveCell.Offset(0, 1).Select
    Range(Selection, Selection.End(xlUp)).Select
    Selection.FillDown
    Range("G3").Select
   
    Columns("F:F").Select
    Selection.Copy
    Columns("G:G").Select
    Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
    Range("H4").Select
    Application.CutCopyMode = False

    Columns("G:G").ColumnWidth = 32.43


    Range("G2").Select
   
    
     Columns("G:G").Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Columns("E:E").Select
    Application.CutCopyMode = False
    With Selection
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlBottom
        .WrapText = False
        .Orientation = 0
        .AddIndent = False
        .IndentLevel = 0
        .ShrinkToFit = False
        .ReadingOrder = xlContext
        .MergeCells = False
    End With
    Range("G1").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .ColorIndex = 0
        .TintAndShade = 0
        .Weight = xlThin
    End With
    Selection.Borders(xlInsideVertical).LineStyle = xlNone
      
    
    
    
    
    
    Sheets("BD").Select
    Range("a1").Select
   
    Application.ScreenUpdating = True
   
    
    
    
    
    
    
    
       
End Sub

You might also like