Expand|Select|Wrap|Line Numbers
- Sub Auto_Open()
- Dim Name As String
- Dim P As String
- Dim Amount As Double
- Dim Cnt01 As Integer
- Dim Cello1 As String
- Dim Formula01 As String
- '
- For Cnt01 = 1 To 40
- Cell01 = "D1"
- Range(Cell01).Select
- Name = InputBox("Insert Name or [EXIT] to exit")
- If Name = "EXIT" Then
- Exit For
- End If
- ActiveCell.FormulaR1C1 = Name
- Cell01 = "D2"
- Range(Cell01).Select
- Name = InputBox("Insert Rate Amount")
- Amount = Val(Name)
- ActiveCell.FormulaR1C1 = Amount
- Cell01 = "D3"
- Range(Cell01).Select
- Name = InputBox("Insert Normal Amount")
- Amount = Val(Name)
- ActiveCell.FormulaR1C1 = Amount
- Cell01 = "D4"
- Range(Cell01).Select
- Name = InputBox("Insert Over Time Amount")
- Amount = Val(Name)
- ActiveCell.FormulaR1C1 = Amount
- Cell01 = "D5"
- Range(Cell01).Select
- Name = InputBox("Insert Sunday Time Amount")
- Amount = Val(Name)
- ActiveCell.FormulaR1C1 = Amount
- Cell01 = "D6"
- Range(Cell01).Select
- Name = InputBox("Insert Leave Bonus Amount")
- Amount = Val(Name)
- ActiveCell.FormulaR1C1 = Amount
- Cell01 = "D7"
- Range(Cell01).Select
- Name = InputBox("Insert Bonus Amount")
- Amount = Val(Name)
- ActiveCell.FormulaR1C1 = Amount
- Cell01 = "D8"
- Range(Cell01).Select
- Name = InputBox("Insert P.A.Y.E. Amount")
- Amount = Val(Name)
- ActiveCell.FormulaR1C1 = Amount
- Cell01 = "D9"
- Range(Cell01).Select
- Name = InputBox("Insert S.I.R.A. Amount")
- Amount = Val(Name)
- ActiveCell.FormulaR1C1 = Amount
- Cell01 = "D10"
- Range(Cell01).Select
- Name = InputBox("Insert U.I.F. Amount")
- Amount = Val(Name)
- ActiveCell.FormulaR1C1 = Amount
- Cell01 = "D11"
- Range(Cell01).Select
- Name = InputBox("Insert Loans Amount")
- Amount = Val(Name)
- ActiveCell.FormulaR1C1 = Amount
- Cell01 = "D12"
- Range(Cell01).Select
- Name = InputBox("Insert Tea Amount")
- Amount = Val(Name)
- ActiveCell.FormulaR1C1 = Amount
- Cell01 = "D13"
- Range(Cell01).Select
- Name = InputBox("Insert Polis Amount")
- Amount = Val(Name)
- Cell01 = "D14"
- Range(Cell01).Select
- Name = InputBox("Insert Name or [P] to print")
- If Name = "P" Then
- ActiveSheet.PageSetup.PrintArea = "$A$16:$H$40"
- Range("G37").Select
- ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
- End If
- fileSaveName = Application.GetSaveAsFilename( _
- fileFilter:="Text Files (*.txt), *.txt")
- If fileSaveName <> False Then
- MsgBox "Save as " & fileSaveName
- End If
- Next Cnt01
- End Sub