[Solved] VBA code question

Maroof702

New member
I am trying to learn this. But I watched a video on creating multiple tabs and aligning tabs. essentially creating tabs within tabs. A way to organize the weeks of the month from one place. It worked but I want to create another tab with the same formulas and VBA code. But when I copy the tab over it doesn't transfer the VBA code. so the tab #2 doesnt work. Is there an easier way to get the buttons to work for this tab. file attached.
 

Attachments

  • payroll tracking 2025 test 2.xlsm
    39.4 KB · Views: 2
I am trying to learn this. But I watched a video on creating multiple tabs and aligning tabs. essentially creating tabs within tabs. A way to organize the weeks of the month from one place. It worked but I want to create another tab with the same formulas and VBA code. But when I copy the tab over it doesn't transfer the VBA code. so the tab #2 doesnt work. Is there an easier way to get the buttons to work for this tab. file attached.
Hello Maroof702

Welcome to ExcelDemy Forum! Thanks for reaching out and sharing your problem with us.

You want to create tabs within tabs with the existing formulas and VBA code attached in the Excel file. After reviewing your file, I saw that the tabs within the Store2 sheet are not working. To make it work, you can easily modify the existing code by creating a new module, renaming sub-procedures, modifying code for sheet2, and assigning the sub-procedure to the buttons.

SOLUTION Overview:

Creating tabs within tabs to make payroll tracking.gif

Follow these steps:
  1. Creating a new module:
    • Press Alt+F11.
    • Click on Insert followed by Module.
    • Copy the existing code and paste it into the new module.
      Create a new module, copy the existing code and paste it into the new module.gif
  2. Renaming sub-procedures:

    Renaming the sub-procedures.gif

  3. Modifying code for sheet2:

    Modifying code for sheet2.gif

  4. Assigning the sub-procedure to the buttons:

    Assigning the sub-procedure to the buttons.gif

I have attached the solution workbook for better understanding; good luck.

Regards
Lutfor Rahman Shimanto
Excel & VBA Developer
ExcelDemy
 

Attachments

  • Maroof702 (SOLVED).xlsm
    38 KB · Views: 0

Online statistics

Members online
0
Guests online
45
Total visitors
45

Forum statistics

Threads
292
Messages
1,268
Members
531
Latest member
lonkfps
Top