boc_est1986
08-16-2011, 01:42 AM
Heres my code. On anything selecting columns excell is selecting all columns instead of just the column asked for. I can't see why. Any help would be appreciated.
Cells.Select
Selection.Copy
Windows("8D KPI").Activate
Sheets("RAW DATA Closed").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("A1").Select
Application.CutCopyMode = False
With ActiveCell.Characters(Start:=1, Length:=6).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With
Range("A2:Z3").Select
With Selection
.WrapText = True
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("A3:N3").Select
Selection.Delete Shift:=xlUp
Range("O2:X2").Select
Selection.Delete Shift:=xlUp
Range("Y3:Z3").Select
Selection.Delete Shift:=xlUp
Columns("E").Select
Selection.Delete Shift:=xlToLeft
Columns("M").Select
Selection.Delete Shift:=xlToLeft
Range("A1").Select
Rows("2:2").Select
Selection.AutoFilter
Selection.AutoFilter Field:=8, Criteria1:="<>Procurement", Operator:= _
xlAnd
Rows("5:5").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
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
Range("A1").Select
Selection.AutoFilter Field:=8
Columns("M").Select
Selection.Insert Shift:=xlToRight
Range("M3").Select
ActiveCell.FormulaR1C1 = "=""D""&RC[1]"
Range("M3").Select
Selection.AutoFill Destination:=Range("M3:M200")
Range("M3:M200").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("M2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "D"
With ActiveCell.Characters(Start:=1, Length:=1).Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 12
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Columns("N").Select
Selection.Delete Shift:=xlToLeft
Columns("N").Select
Selection.Insert Shift:=xlToRight
Range("N2").Select
ActiveCell.FormulaR1C1 = "D3 Comleted"
With ActiveCell.Characters(Start:=1, Length:=11).Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 12
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("N3").Select
ActiveCell.FormulaR1C1 = "=RC[-2]-RC[-11]"
Range("N3").Select
Selection.AutoFill Destination:=Range("N3:N21")
Range("N3:N21").Select
Selection.NumberFormat = "0"
Range("N2").Select
Cells.Select
Selection.Copy
Windows("8D KPI").Activate
Sheets("RAW DATA Closed").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("A1").Select
Application.CutCopyMode = False
With ActiveCell.Characters(Start:=1, Length:=6).Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With
Range("A2:Z3").Select
With Selection
.WrapText = True
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("A3:N3").Select
Selection.Delete Shift:=xlUp
Range("O2:X2").Select
Selection.Delete Shift:=xlUp
Range("Y3:Z3").Select
Selection.Delete Shift:=xlUp
Columns("E").Select
Selection.Delete Shift:=xlToLeft
Columns("M").Select
Selection.Delete Shift:=xlToLeft
Range("A1").Select
Rows("2:2").Select
Selection.AutoFilter
Selection.AutoFilter Field:=8, Criteria1:="<>Procurement", Operator:= _
xlAnd
Rows("5:5").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Delete Shift:=xlUp
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
Range("A1").Select
Selection.AutoFilter Field:=8
Columns("M").Select
Selection.Insert Shift:=xlToRight
Range("M3").Select
ActiveCell.FormulaR1C1 = "=""D""&RC[1]"
Range("M3").Select
Selection.AutoFill Destination:=Range("M3:M200")
Range("M3:M200").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("M2").Select
Application.CutCopyMode = False
ActiveCell.FormulaR1C1 = "D"
With ActiveCell.Characters(Start:=1, Length:=1).Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 12
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Columns("N").Select
Selection.Delete Shift:=xlToLeft
Columns("N").Select
Selection.Insert Shift:=xlToRight
Range("N2").Select
ActiveCell.FormulaR1C1 = "D3 Comleted"
With ActiveCell.Characters(Start:=1, Length:=11).Font
.Name = "Arial"
.FontStyle = "Bold"
.Size = 12
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("N3").Select
ActiveCell.FormulaR1C1 = "=RC[-2]-RC[-11]"
Range("N3").Select
Selection.AutoFill Destination:=Range("N3:N21")
Range("N3:N21").Select
Selection.NumberFormat = "0"
Range("N2").Select