Good afternoon.
I want to determine an amount of pay in local currency according to 3 conditions [frequency of pay]: (daily pay, monthly pay, one-off pay)
If pay is in daily mode, amount of pay is : daily pay = daily pay * 5 * 24
If pay is in montly mode, amount of pay is: montly pay * 6
If pay is one-off pay, amount of pay is: one-off pay
1] My code:
I want to determine an amount of pay in local currency according to 3 conditions [frequency of pay]: (daily pay, monthly pay, one-off pay)
If pay is in daily mode, amount of pay is : daily pay = daily pay * 5 * 24
If pay is in montly mode, amount of pay is: montly pay * 6
If pay is one-off pay, amount of pay is: one-off pay
1] My code:
VBA Code:
Sub Fill_in_form()
Dim starting_date_internship As String
Dim interval_type As String
Dim ending_date_internship As Date
Dim number_of_months_to_add As Integer
Dim objectives_and_missions_internship As String
Dim registered_company_name As String
Dim commercial_company_name As String
Dim VATno_number_company As Variant
Dim contact_number_company As Variant
Dim department_internship As String
Dim first_name_supervisor As String
Dim last_name_supervisor As String
Dim Gender_OptionButton1 As OptionButton
Dim gender_supervisor As String
Dim job_title_supervisor As String
Dim email_adress_supervisor As String
Dim professional_phone_number_supervisor As Variant
Dim frequency_of_pay As String
Do
starting_date_internship = InputBox("Enter starting date internship [DD/MM/YYYY]")
If Not IsDate(starting_date_internship) Then MsgBox "Enter a valid format for starting date internship DD/MM/YYYY"
Loop While Not IsDate(starting_date_internship)
Range("B2") = starting_date_internship
interval_type = "m"
number_of_months_to_add = InputBox("Enter number of months for the internship")
Range("B3") = number_of_months_to_add
ending_date_internship = DateAdd(interval_type, number_of_months_to_add, starting_date_internship)
Range("B4") = ending_date_internship
objectives_and_missions_internship = InputBox("Enter objectives and missions during internship")
Range("B5") = objectives_and_missions_internship
registered_company_name = InputBox("Enter registered trade name of the company")
Range("B8") = registered_company_name
commercial_company_name = InputBox("Enter commercial name of the company")
Range("B9") = commercial_company_name
Do
VATno_number_company = InputBox("Please enter the VATno number of the company")
If Not Len(VATno_number_company) = 10 Then MsgBox VATno_number_company & " is not a 10 digit number"
Loop Until Len(VATno_number_company) = 10
Range("B10") = VATno_number_company
contact_number_company = InputBox("Enter contact number of the company")
Range("B15") = contact_number_company
department_internship = InputBox("Enter department of internship")
Range("B18") = title_internship_supervisor
title_internship_supervisor = InputBox("Enter title of supervisor [Mr. or Mrs.]")
Range("B19") = first_name_supervisor
first_name_supervisor = InputBox("Enter first name of supervisor")
Range("B19") = first_name_supervisor
last_name_supervisor = InputBox("Enter last name name of supervisor")
Range("B20") = last_name_supervisor
If title_internship_supervisor = "Mr." Then gender_supervisor = "M"
Else
gender_supervisor = "F"
End If
Range("B21") = gender_supervisor
job_title_supervisor = InputBox("Enter job title of supervisor")
Range("B22") = job_title_supervisor
email_adress_supervisor = InputBox("Enter email adress of supervisor")
Range("B23") = email_adress_supervisor
professional_phone_number_supervisor = InputBox("Enter professionnal phone number of supervisor [+ 45 xx xx xx xx]")
Range("B24") = professional_phone_number_supervisor
frequency_of_pay = InputBox("Enter frequency of pay in local currency [daily, monthly or one-off payment]")
Range("B25") = frequency_of_pay
amount_of_pay_in_local_currency = InputBox("Enter amount of pay in local currency")
End Sub