Macros and Shared Workbook

alexwoje

New Member
Joined
Dec 29, 2021
Messages
7
Office Version
  1. 365
Platform
  1. Windows
I have a task tracking sheet that multiple members of my team will be using. The idea it that each person will have their own worksheet within a signal workbook. Each sheet needs to function the same, the only difference will be the name associated with the sheet. This is the sheet:

JR Time Tracker.xlsm
ABCDEFGHI
1
2
3Junior Manager Time Tracker
4
5
6
7DateNameTaskAssigned ByClientStart TimeEnd TimeTotal Time
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
TimeTrackerJR
Cells with Data Validation
CellAllowCriteria
D8:D1048576List=Support!$A$4:$A$31
E8:E1048576List=Support!$C$4:$C$15
F8:F1048576List=Support!$E$4:$E$100



And these are the current macros:

Sub Intialize()

Dim iRow As Long

iRow = Sheets("TimeTrackerJR").Range("H" & Application.Rows.Count).End(xlUp).Row + 1

'Code to Validate

If Sheets("TimeTrackerJR").Range("F" & iRow).Value = "" Then

Sheets("TimeTrackerJR").Range("B" & iRow).Value = Format([Today()], "DD-MMM-YYYY")
Sheets("TimeTrackerJR").Range("C" & iRow).Value = Application.UserName

End If

End Sub


Sub Start_Time()

Dim iRow As Long

iRow = Sheets("TimeTrackerJR").Range("H" & Application.Rows.Count).End(xlUp).Row + 1

'Code to Validate

If Sheets("TimeTrackerJR").Range("D" & iRow).Value = "" Then

MsgBox "Please select the Task Name from the drop down.", vbOKOnly + vbInformation, "Task Name Blank"
Sheets("TimeTrackerJR").Range("D" & iRow).Select
Exit Sub

ElseIf Sheets("TimeTrackerJR").Range("G" & iRow).Value <> "" Then

MsgBox "Start Time is aleady captured for the selected Task."
Exit Sub
Else

Sheets("TimeTrackerJR").Range("G" & iRow).Value = [Now()]

Sheets("TimeTrackerJR").Range("G" & iRow).NumberFormat = "hh:mm:ss AM/PM"

End If

End Sub


Sub End_Time()

Dim iRow As Long

iRow = Sheets("TimeTrackerJR").Range("I" & Application.Rows.Count).End(xlUp).Row + 1


'Code to Validate

If Sheets("TimeTrackerJR").Range("G" & iRow).Value = "" Then

MsgBox "Start Time has not been captured for this task."
Exit Sub
Else

Sheets("TimeTrackerJR").Range("H" & iRow).Value = [Now()]

Sheets("TimeTrackerJR").Range("H" & iRow).NumberFormat = "hh:mm:ss AM/PM"

Sheets("TimeTrackerJR").Range("I" & iRow).Value = Sheets("TimeTrackerJR").Range("H" & iRow).Value - Sheets("TimeTrackerJR").Range("G" & iRow).Value

Sheets("TimeTrackerJR").Range("I" & iRow).NumberFormat = "hh:mm:ss"

End If

'Fill the Date and Name in next row
Call Initialize

End Sub


Will I run into any issues copying this main sheet to other tabs?
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
macros can certainly be reused across different tabs. You may want to explore the use of 'Activesheet' rather than specifying a specific sheet name wherever possible to make the script more easily reusable across sheets.
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,547
Members
449,089
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top