top of page

Empresa: NYK

Gestor: Bruno

Projeto: TT

TIMETABLE

Tech Guide

top

OCP Documentation:

The Tech Guide as well as the documentation written down has been put together to serve as support material for technical professionals who have in-depth knowledge of:

> The tool

> Calculus 

> Programming & Logic

> The business

!

'Libera' Macro
Anchor 1

The macro Libera is designed to unlock and unprotect various sheets in the workbook after verifying a password. Here’s a breakdown of how it works:

Macro Breakdown:
Password Setup:

The macro defines a variable Senha1 and assigns it the Timetable password which is the correct password required to unlock the workbook.
Password Input:

The macro prompts the user with an input box (InputBox) to enter a password. The entered password is stored in the variable Resposta.
Password Verification:

The macro checks if the password entered by the user (Resposta) matches the predefined password (Senha1).
If the password does not match, a message box (MsgBox) appears with the warning "Senha Incorreta" (Incorrect Password), and the macro exits (Exit Sub), meaning no further actions are taken.
Unprotect Workbook and Sheets:

If the password is correct, the macro proceeds to unprotect the workbook and several specified worksheets using the correct password:
ThisWorkbook.Unprotect: Unprotects the entire workbook.
Worksheets("Base Zero").Unprotect: Unprotects the "Base Zero" sheet.
Worksheets("Base Real").Unprotect: Unprotects the "Base Real" sheet.
Worksheets("Timetable").Unprotect: Unprotects the "Timetable" sheet.
Worksheets("Timetable - V0").Unprotect: Unprotects the "Timetable - V0" sheet.
Worksheets("Report").Unprotect: Unprotects the "Report" sheet.
Make Hidden Sheets Visible:

The macro then makes certain hidden sheets visible:
Worksheets("Settings").Visible = True: Makes the "Settings" sheet visible.
Worksheets("Params_Voy").Visible = True: Makes the "Params_Voy" sheet visible.
Worksheets("Params_Constant").Visible = True: Makes the "Params_Constant" sheet visible.
Worksheets("Report").Visible = True: Makes the "Report" sheet visible.
Select and Focus:

Finally, the macro selects the "Settings" sheet (Sheets("Settings").Select) and places the cursor in cell A1 (Range("A1").Select), ensuring the user is directed to this location after running the macro.
Purpose:
This macro is used to unlock the workbook and specific sheets that are otherwise protected and hidden. It allows users with the correct password to access and modify the contents of these sheets, as well as to make certain settings visible. This functionality is useful for providing controlled access to sensitive data or settings within the workbook.

Trigger:
image.png
'Segurança' Macro
Anchor 2

The macro Seguranca is designed to apply a security setup by filtering specific data on the "Timetable" sheet, hiding sensitive sheets, and reapplying protection to the workbook and several sheets. Here's how it works:

Macro Breakdown:

  1. Unprotect the "Timetable" Sheet:

    • The macro begins by unprotecting the "Timetable" sheet using a password to allow changes to be made.

  2. Filter Data on the "Timetable" Sheet:

    • The macro applies an AutoFilter to the range W8:W288 on the "Timetable" sheet. It filters the data based on specific criteria: "1", "2", "3", "4", "5", "T", and "-". This step likely hides or isolates rows that match these values in column W.

  3. Hide Sensitive Sheets:

    • The macro then hides several worksheets, making them invisible to the user:

      • "Settings"

      • "Params_Voy"

      • "Params_Constant"

      • "Calculations"

      • "Report"

      • "CII - Vessel GT"

      • "CII - Parameters"

      • "CII - BASE TOM"

      • "CII"

  4. Re-Protect the Workbook and Sheets:

    • The macro re-protects the entire workbook with the password and locks the workbook structure (so users cannot unhide sheets or add new ones).

    • It also re-protects several key sheets, including:

      • "Base Zero"

      • "Base Real"

      • "Timetable"

      • "Timetable - V0"

    • Protection allows for formatting columns, formatting rows, and applying filters, ensuring users can still interact with the data in specific ways while preventing unauthorized modifications.

  5. Select the "Guidelines" Sheet:

    • Finally, the macro selects the "Guidelines" sheet and places the cursor in cell A1, directing the user to this location after the security setup is applied.

Purpose:

This macro is used to secure the workbook by filtering specific data, hiding sensitive sheets, and applying protections to the workbook and important sheets. It ensures that only authorized users can view or modify certain data while allowing specific interactions, such as filtering, to remain available. This setup helps maintain the integrity and confidentiality of the information within the workbook.

Trigger:
image.png

©2025 by BeNext Solutions.

bottom of page