From f8f5bce9940e1a6471ebd734c6a1944cc50ae8d1 Mon Sep 17 00:00:00 2001 From: Dan Howe Date: Wed, 16 Oct 2019 09:25:03 +1100 Subject: [PATCH] Prepare v3 --- costing-tool-module-1.vbs | 72 ++++++++++++++------------------------- 1 file changed, 25 insertions(+), 47 deletions(-) diff --git a/costing-tool-module-1.vbs b/costing-tool-module-1.vbs index 73d46c1..0d56af6 100644 --- a/costing-tool-module-1.vbs +++ b/costing-tool-module-1.vbs @@ -1,16 +1,14 @@ -Sub R_More_50() +Sub MECR_35() ' ' R_More_50 Macro ' Range("G2").Select - ActiveCell.FormulaR1C1 = "0.10" - Range("I2").Select ActiveCell.FormulaR1C1 = "0.35" ' MsgBox Application.Caller - use this to check what the option button is called End Sub -Sub R_Less_50() +Sub MECR_50() ' ' R_Less_50 Macro @@ -24,8 +22,6 @@ Sub R_Less_50() If X = False Then Range("G2").Select - ActiveCell.FormulaR1C1 = "0.25" - Range("I2").Select ActiveCell.FormulaR1C1 = "0.50" Else MsgBox "The worksheet is protected please unlock worksheet to select this option." & vbNewLine & "Please see the WRL Manager Mr Grantley Smith" @@ -52,6 +48,9 @@ Sub copytemp() Sheets("Salary Information").Visible = False Sheets("RPU Budget_Template").Visible = True + + 'creates a copy of the "project template" with the project name to start pasting information + Sheets("RPU Budget_Template").Select Sheets("RPU Budget_Template").Copy After:=Sheets(3) Sheets("RPU Budget_Template (2)").Select @@ -63,7 +62,7 @@ Sub copytemp() Sheets(projectname).Select -' adds project details + ' adds project details Range("B3").Select Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "='Project Information'!R[-2]C[2]" @@ -75,11 +74,11 @@ Sub copytemp() ActiveCell.FormulaR1C1 = "='Project Information'!RC:RC[3]" Range("F1").Select -'adds generation timestamp + 'adds generation timestamp ActiveCell.FormulaR1C1 = "=NOW()" Range("F2").Select -'copy staff + 'copy staff Sheets("Project Information").Select Range("D13:M13").Select Selection.Copy @@ -92,18 +91,18 @@ Sub copytemp() :=False, Transpose:=True Application.CutCopyMode = False - 'copy salary markup + 'copy salary markup Sheets("Project Information").Select Range("D12:M12").Select Selection.Copy Sheets(projectname).Select - Range("Q21").Select + Range("T21").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=True Application.CutCopyMode = False - 'copy hours + 'copy hours Sheets("Project Information").Select Range("D17:M17").Select Selection.Copy @@ -111,30 +110,8 @@ Sub copytemp() Range("G21").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=True - ' copy mark up percentage - Sheets("Project Information").Select - Range("I2").Select - Selection.Copy - Sheets(projectname).Select - Range("S21").Select - Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ - :=False, Transpose:=False - Range("H8").Select - Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ - :=False, Transpose:=False - - Sheets("Project Information").Select - Range("G2").Select - Selection.Copy - Sheets(projectname).Select - Range("S35").Select - Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ - :=False, Transpose:=False - Range("S43").Select - Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ - :=False, Transpose:=False - 'Copy subcontractors + 'Copy subcontractors Sheets("Project Information").Select Range("C71:C75").Select Selection.Copy @@ -142,7 +119,7 @@ Sub copytemp() Range("A35").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False - 'Copy subcontractor prices + 'Copy subcontractor prices Sheets("Project Information").Select Range("N71:N75").Select Selection.Copy @@ -153,7 +130,7 @@ Sub copytemp() Range("F35").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False - 'Copy subcontractor markups + 'Copy subcontractor markups Sheets("Project Information").Select Range("M71:M75").Select Selection.Copy @@ -162,7 +139,7 @@ Sub copytemp() Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False - 'Copy expense items + 'Copy expense items Sheets("Project Information").Select Range("C78:C92").Select Selection.Copy @@ -179,7 +156,7 @@ Sub copytemp() Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False - 'Copy expense prices + 'Copy expense prices Sheets("Project Information").Select Range("N78:N92").Select Selection.Copy @@ -196,7 +173,7 @@ Sub copytemp() Sheets(projectname).Select Range("A1").Select - 'Copy expense price markups + 'Copy expense price markups Sheets("Project Information").Select Range("M78:M92").Select @@ -208,21 +185,22 @@ Sub copytemp() Sheets(projectname).Select Range("A1").Select + + ' hides sheets + Sheets("StaffDetails").Visible = False + Sheets("Salary Information").Visible = False + Sheets("RPU Budget_Template").Visible = False + 'ProtectSheet ActiveSheet.Protect AllowInsertingColumns:=False, _ AllowInsertingRows:=False, _ AllowDeletingColumns:=False, _ AllowDeletingRows:=False - Sheets("Project Information").Select Range("A1").Select - - - ' hides sheets - Sheets("StaffDetails").Visible = False - Sheets("Salary Information").Visible = False - Sheets("RPU Budget_Template").Visible = False + Sheets(projectname).Select + Application.Goto Reference:=Range("a1"), Scroll:=True End Sub