Sub Embryo_code()
'
' Embryo_code Macro
'
' Keyboard Shortcut: Ctrl+r
'
Range("P8").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Range("K8").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.Replace What:="_yes", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="_no", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Selection.Replace What:="_maybe", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
Range("A7").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
sheets.Add
ActiveWorkbook.Worksheets("Sheet6").PivotTables("PivotTable2").PivotCache. _
CreatePivotTable TableDestination:="Sheet2!R3C1", TableName:="PivotTable1" _
, DefaultVersion:=xlPivotTableVersion14
sheets("Sheet2").Select
Cells(3, 1).Select
With ActiveSheet.PivotTables("PivotTable1").PivotFields("PK Tariff")
.Orientation = xlRowField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable1").PivotFields("PK Fuel")
.Orientation = xlRowField
.Position = 2
End With
With ActiveSheet.PivotTables("PivotTable1").PivotFields("RC Prod Type")
.Orientation = xlRowField
.Position = 3
End With
With ActiveSheet.PivotTables("PivotTable1").PivotFields("RC Charge")
.Orientation = xlRowField
.Position = 4
End With
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Key4")
.Orientation = xlRowField
.Position = 5
End With
ActiveSheet.PivotTables("PivotTable1").AddDataField ActiveSheet.PivotTables( _
"PivotTable1").PivotFields("Key11"), "Count of Key11", xlCount
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Key2")
.Orientation = xlColumnField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Count of Key11")
.Caption = "Sum of Key11"
.Function = xlSum
End With
ActiveWindow.SmallScroll Down:=9
Range("A19").Select
ActiveSheet.PivotTables("PivotTable1").PivotFields("Key4").Subtotals = Array( _
False, False, False, False, False, False, False, False, False, False, False, False)
Range("B33").Select
With ActiveSheet.PivotTables("PivotTable1")
.InGridDropZones = True
.RowAxisLayout xlTabularRow
End With
Range("B21").Select
ActiveSheet.PivotTables("PivotTable1").PivotFields("PK Fuel").Subtotals = Array _
(False, False, False, False, False, False, False, False, False, False, False, False)
Range("A25").Select
ActiveSheet.PivotTables("PivotTable1").PivotFields("PK Tariff").Subtotals = _
Array(False, False, False, False, False, False, False, False, False, False, False, False)
Range("C24").Select
ActiveSheet.PivotTables("PivotTable1").PivotFields("RC Prod Type").Subtotals = _
Array(False, False, False, False, False, False, False, False, False, False, False, False)
Range("D21").Select
ActiveSheet.PivotTables("PivotTable1").PivotFields("RC Charge").Subtotals = _
Array(False, False, False, False, False, False, False, False, False, False, False, False)
Range("I25").Select
ActiveWindow.SmallScroll Down:=-36
Cells.Select
Selection.Copy
sheets.Add After:=sheets(sheets.Count)
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("G5").Select
Columns("E:E").EntireColumn.AutoFit
sheets("Sheet3").Select
End Sub
Bookmarks