Sub Button5_Click()
Dim x As Date
Dim i As Integer
On Error GoTo Errorcatch
For i = 1050 To 5000
If Cells(i, 1).Value = VBA.Date Then
Cells(2, 1).Value = VBA.Date
Worksheets("Reservoir Voidage Replacement").Activate
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Reservoir Voidage Replacement").Range(Cells(i - 2, 10), Cells(i - 2, 13)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 10), Cells(i - 1, 13)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Reservoir Voidage Replacement").Range(Cells(i - 2, 17), Cells(i - 2, 18)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 17), Cells(i - 1, 18)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Reservoir Voidage Replacement").Range(Cells(i - 2, 20), Cells(i - 2, 33)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 20), Cells(i - 1, 33)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Reservoir Voidage Replacement").Range(Cells(i - 2, 46), Cells(i - 2, 48)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 46), Cells(i - 1, 48)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Reservoir Voidage Replacement").Range(Cells(i - 2, 50), Cells(i - 2, 58)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 50), Cells(i - 1, 58)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Reservoir Voidage Replacement").Range(Cells(i - 2, 60), Cells(i - 2, 88)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 60), Cells(i - 1, 88)), Type:=xlFillCopy
Worksheets("Prod Allocation").Activate
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Prod Allocation").Range(Cells(i - 2, 8), Cells(i - 2, 122)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 8), Cells(i - 1, 122)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Prod Allocation").Range(Cells(i - 2, 125), Cells(i - 2, 125)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 125), Cells(i - 1, 125)), Type:=xlFillCopy
Worksheets("Inj Allocation").Activate
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Inj Allocation").Range(Cells(i - 2, 3), Cells(i - 2, 5)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 3), Cells(i - 1, 5)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Inj Allocation").Range(Cells(i - 2, 7), Cells(i - 2, 9)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 7), Cells(i - 1, 9)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Inj Allocation").Range(Cells(i - 2, 11), Cells(i - 2, 15)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 11), Cells(i - 1, 15)), Type:=xlFillCopy
Worksheets("Inj Index (Source)").Activate
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Inj Index (Source)").Range(Cells(i - 2, 3), Cells(i - 2, 5)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 3), Cells(i - 1, 5)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Inj Index (Source)").Range(Cells(i - 2, 8), Cells(i - 2, 8)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 8), Cells(i - 1, 8)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Inj Index (Source)").Range(Cells(i - 2, 13), Cells(i - 2, 21)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 13), Cells(i - 1, 21)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Inj Index (Source)").Range(Cells(i - 2, 23), Cells(i - 2, 25)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 23), Cells(i - 1, 25)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Inj Index (Source)").Range(Cells(i - 2, 28), Cells(i - 2, 28)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 28), Cells(i - 1, 28)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Inj Index (Source)").Range(Cells(i - 2, 33), Cells(i - 2, 41)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 33), Cells(i - 1, 41)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Inj Index (Source)").Range(Cells(i - 2, 43), Cells(i - 2, 45)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 43), Cells(i - 1, 45)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Inj Index (Source)").Range(Cells(i - 2, 48), Cells(i - 2, 48)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 48), Cells(i - 1, 48)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Inj Index (Source)").Range(Cells(i - 2, 53), Cells(i - 2, 63)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 53), Cells(i - 1, 63)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Inj Index (Source)").Range(Cells(i - 2, 66), Cells(i - 2, 67)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 66), Cells(i - 1, 67)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Inj Index (Source)").Range(Cells(i - 2, 66), Cells(i - 2, 67)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 66), Cells(i - 1, 67)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Inj Index (Source)").Range(Cells(i - 2, 75), Cells(i - 2, 79)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 75), Cells(i - 1, 79)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Inj Index (Source)").Range(Cells(i - 2, 91), Cells(i - 2, 92)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 91), Cells(i - 1, 92)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Inj Index (Source)").Range(Cells(i - 2, 100), Cells(i - 2, 114)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 100), Cells(i - 1, 114)), Type:=xlFillCopy
Worksheets("DD & PI (Source)").Activate
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("DD & PI (Source)").Range(Cells(i - 2, 5), Cells(i - 2, 5)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 5), Cells(i - 1, 5)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("DD & PI (Source)").Range(Cells(i - 2, 9), Cells(i - 2, 20)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 9), Cells(i - 1, 20)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("DD & PI (Source)").Range(Cells(i - 2, 24), Cells(i - 2, 24)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 24), Cells(i - 1, 24)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("DD & PI (Source)").Range(Cells(i - 2, 29), Cells(i - 2, 39)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 29), Cells(i - 1, 39)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("DD & PI (Source)").Range(Cells(i - 2, 43), Cells(i - 2, 43)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 43), Cells(i - 1, 43)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("DD & PI (Source)").Range(Cells(i - 2, 47), Cells(i - 2, 58)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 47), Cells(i - 1, 58)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("DD & PI (Source)").Range(Cells(i - 2, 62), Cells(i - 2, 62)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 62), Cells(i - 1, 62)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("DD & PI (Source)").Range(Cells(i - 2, 66), Cells(i - 2, 77)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 66), Cells(i - 1, 77)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("DD & PI (Source)").Range(Cells(i - 2, 85), Cells(i - 2, 100)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 85), Cells(i - 1, 100)), Type:=xlFillCopy
Worksheets("Adjusted Allocation").Activate
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Adjusted Allocation").Range(Cells(i - 2, 8), Cells(i - 2, 116)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 8), Cells(i - 1, 116)), Type:=xlFillCopy
Worksheets("Adjusted Oil Volumes").Activate
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Adjusted Oil Volumes").Range(Cells(i - 2, 2), Cells(i - 2, 7)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 2), Cells(i - 1, 7)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Adjusted Oil Volumes").Range(Cells(i - 2, 9), Cells(i - 2, 12)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 9), Cells(i - 1, 12)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Adjusted Oil Volumes").Range(Cells(i - 2, 24), Cells(i - 2, 26)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 24), Cells(i - 1, 26)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Adjusted Oil Volumes").Range(Cells(i - 2, 33), Cells(i - 2, 34)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 33), Cells(i - 1, 34)), Type:=xlFillCopy
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Adjusted Oil Volumes").Range(Cells(i - 2, 85), Cells(i - 2, 86)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 85), Cells(i - 1, 86)), Type:=xlFillCopy
Worksheets("Field Prod vs Budget Calcs").Activate
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("Field Prod vs Budget Calcs").Range(Cells(i - 2, 2), Cells(i - 2, 40)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 2), Cells(i - 1, 40)), Type:=xlFillCopy
Worksheets("GOR Model Template").Activate
Workbooks("Voidage Replacement & Production Allocation.xlsm").Sheets("GOR Model Template").Range(Cells(i - 2, 2), Cells(i - 2, 25)).Select
Selection.AutoFill Destination:=Range(Cells(i - 2, 2), Cells(i - 1, 25)), Type:=xlFillCopy
Worksheets("Reservoir Voidage Replacement").Activate
MsgBox "Data Retrieval is Completed"
Else: End If
Next
Errorcatch: MsgBox Err.Description
End Sub
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Bookmarks