Basically, I need a database on sheet #2 to keep track of date and hours on sheet #1.
I have a time sheet using Excel 2007 (company built timesheet). The time sheet is located on Sheet #1 of the workbook. I have a column on the time sheet for vacation time and a total at the bottom of the column for the amount of vacation hours taken.
My time sheet is only one week long and when the week is over, I change the date cell for Sunday to the following Sunday date (i.e.
cell D4: 1/1/2011 change it to 1/8/2011).
What I want to do is on sheet #2 is to keep track of ALL vacation time taken for the year. I know that if I change the date and hour cells on sheet #1 it will change the cells on sheet #2. Basically, I need to know how to establish a database on sheet
#2, while utilizing sheet #1 as a form. I don't have Microsoft Access to use as a database. Am I going to have to enter my vacation time and dates manually on sheet #2?
Anwsers to the Problem Basically, I need a database on sheet #2 to keep track of date and hours on sheet #1.
I'm doing this for a friend.
His company payroll department constructed the time sheet and stated to him not to change it.
Hello again Keith,
I guess that my first question now is if the workbook has been designed by someone else then is it possible to add a worksheet or is it locked up so that only times can be entered?
In any case I can't resist a challenge and have come up with some code that will record all leave taken.
The user just needs to double click cell I18 or J19 to update.
It does not matter how many times the user double clicks one of the cells, the data will
simply update to the latest on the time sheet.
To install the code:
Alt/F11 to open the VBA Editor.
Select menu item Insert -> Module.
Copy the following code and paste it into the large white area.
Note that only the code down to my next instructions to be copied at this stage.
See further instructions below this code.
In the VBA editor, Comments are in Green and the green lines are not processed as code.
Note that they become a comment by inserting a single quote at the beginning of the line.
Read the comments and you may need to edit some places; particularly the part
between the asterisk lines for the format of the time cells.
Sub UpDateLeave(rngDate As Range)
Dim rngToSearch As Range
Dim rngToFind As Range
Dim rngToSort As Range
Dim rngKey As Range
Set rngToSearch = Sheets("Leave Record").Columns("A:A")
Set rngToFind = .Find(What:=rngDate.Value, _
If rngToFind Is Nothing Then 'Date not found
With Sheets("Leave Record")
'Assign next blank cell in column A to rngToFind variable
Set rngToFind = .Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0)
rngToFind = rngDate 'Populate the cell with the date not found.
'Populate Sick Leave and Vacation columns.
rngToFind.Offset(0, 1) = rngDate.Offset(0, 8)
rngToFind.Offset(0, 2) = rngDate.Offset(0, 9)
With ActiveWorkbook.Worksheets("Leave Record")
Set rngToSort = .Range(.Cells(1, 1), .Cells(.Rows.Count, 3).End(xlUp))
Set rngKey = rngToSort.Columns(1)
.Sort.SortFields.Add Key:=rngKey, _
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
Dim wsThis As Worksheet
Dim wsLeave As Worksheet
Set wsThis = ActiveSheet
On Error Resume Next
Set wsLeave = Sheets("Leave Record")
If Err.Number > 0 Then
On Error GoTo 0
Set wsLeave = ActiveSheet
wsLeave.Name = "Leave Record"
.Cells(1, 1) = "Date"
.Cells(1, 2) = "Sick Leave"
.Cells(1, 3) = "Vacation"
.Range(.Cells(1, 1), .Cells(1, 3)).Font.Bold = True
.Range("A:A").NumberFormat = "dd mmm yyyy" 'Edit to required date format
'Edit and Comment out the formats not required
.Range("B:C").NumberFormat = "[hh]:mm" 'Hours and minutes format
'.Range("B:C").NumberFormat = "0" 'Number format
'.Range("B:C").NumberFormat = "0.00" 'Number format with 2 decimals
On Error GoTo 0
Now the next part of instructions.
(Stay in the VBA editor)
Double click the worksheet name in the project explorer (the left column) that matches the name of the worksheet where the user enters the times.
A new page of the VBA editors opens.
This module (page) belongs to the worksheet that was double clicked.
Copy the following code into that worksheet module.
(This is the code that determines what to do when the cell is double clicked.)
Private Sub Worksheet_BeforeDoubleClick _
(ByVal Target As Range, Cancel As Boolean)
Cancel = True 'Cancels Edit mode invoked with double click.
Dim r As Long
Select Case Target.Address(0, 0)
Case "I18", "J18"
Call SetUp 'First time use only
If Range("I18") = 0 And Range("J18") = 0 Then
Exit Sub 'Total is zero so nothing to save
For r = 11 To 17
If Range("I" & r) > 0 Or Range("J" & r) > 0 Then
Call UpDateLeave(Range("A" & r))
End of code to be copied.
(Don't copy this line.)
The code will automatically create the worksheet for the leave record if it does not already exist.
If the user wants to have a new sheet for start of year/period, then after starting a new week, just double click the worksheet name tab and rename it something like
Leave Record 2011 and the next time the total cells are double clicked then a new worksheet will be created.
Manually editing the Windows registry
Manually editing the Windows registry to remove invalid MACHINE_CHECK_EXCEPTION keys is not recommended unless you are PC service professional. Incorrectly editing your registry can stop your PC from functioning and create irreversible damage to your operating system. In fact, one misplaced comma can prevent your PC from booting entirely!
Caution: Unless you an advanced PC user, we DO NOT recommend editing the Windows registry manually. Using Registry Editor incorrectly can cause serious problems that may require you to reinstall Windows. We do not guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.
To manually repair your Windows registry, first you need to create a backup by exporting a portion of the registry related to MACHINE_CHECK_EXCEPTION (eg. Windows Operating System):
- Click the Start button.
- Type "command" in the search box... DO NOT hit ENTER yet!
- While holding CTRL-Shift on your keyboard, hit ENTER.
- You will be prompted with a permission dialog box.
- Click Yes.
- A black box will open with a blinking cursor.
- Type "regedit" and hit ENTER.
- In the Registry Editor, select the Error 0x9C-related key (eg. Windows Operating System) you want to back up.
- From the File menu, choose Export.
- In the Save In list, select the folder where you want to save the Windows Operating System backup key.
- In the File Name box, type a name for your backup file, such as "Windows Operating System Backup".
- In the Export Range box, be sure that "Selected branch" is selected.
- Click Save.
- The file is then saved with a .reg file extension.
- You now have a backup of your MACHINE_CHECK_EXCEPTION-related registry entry.
Another Safe way to Repair the Problem: Basically, I need a database on sheet #2 to keep track of date and hours on sheet #1.:
How to Fix Basically, I need a database on sheet #2 to keep track of date and hours on sheet #1. with SmartPCFixer?
1. You can Download SmartPCFixer here. Install it on your system. When you open it, it will perform a scan.
2. After the scan is done, you can see the errors and problems need to be fixed. Click Fix All.
3. The Fixing part is done, the speed of your computer will be much higher than before and the errors have been removed.
Related: Autologon and AutoLogonCount Parameters for Windows Unattended Setup Error Fixer,How To Resolve Cyberbit Unicode Font Does Not Return Correct Charset Problem,How To Use the Office Profile Wizard to Create an OPS File in Office XP Error Fixer,Error Sys Msg 22 Invalid period, please reenter. in MC in 4.x Solution,Why am I Getting a Upgrades from 3.01 to 3.60 or 3.01 to 3.70 Involving Serial Numbers and Revaluations Are Overstating the Valuation Entries on the Purchases Error?,How Can I Fix - Error 16389?,How to Fix - Internetopen?,Mcafee Virus Scan Online,How Can I Fix - Qos Packet Scheduler Failed?,Solution to Problem: Windows 2000 Boot Repair,How to Fix ashoutxt.dll Not Found Error,Best Method to Fix cxcore096.dll Error,Where can I Find dsauth.dll File,msde.dll Corrupted - How to Resolve,psizewizres.dll Corrupted - How to Fix,How to Download ASUS XGI Compatible Super VGA Driver Package Version R1.13.00/Driver Version 184.108.40.2060 for Windows XP 32/64 bit(WHQL),Windows Server 2003 32/64 bit(WHQL),Windows Vista 32/64 bit(WHQL),Windows Server 2008 32/64 bit(WHQL),Windows 7 32/64 bit(WHQL),Window,Download NeoMagic® MagicMedia 256AVP Display Adapter Driver,Download NVIDIA RIVA TNT2 Model 64,How to Update Realtek ALC850 AC'97 Driver V220.127.116.1100 WHQL for Windows 2000/XP/2003 & 64bit XP/2003.,How to Update Realtek LAN V6.203.0214.2008,Microsoft.PowerShell.GraphicalHost.dll Error Code Fixer
,Fix Error Code Netapi32 (4).dll
,Qa_auth_client.dll Error Code Fixer
,Fix Error Code Tdc (3).ocx
,Vwipxspx.dll Error Code Fixer
,Way to Download Toshiba Qosmio X505-Q832 Intel Wireless LAN Driver v.18.104.22.168.0.s64_wCAT,Download Toshiba Satellite C650D-ST6N02 Assist Utility v.22.214.171.124 driver,How Can You Update & Download Toshiba Satellite L645-S4026RD Value Added Package v.1.6.0130.640202 driver,Method to Download Toshiba Satellite L755-S9511D Assist Utility v.126.96.36.199 driver,Method to Download Toshiba Satellite P875-S7200 Fingerprint Utility v.2.0.0001.000408 driver,Best Way to Download NVidia GeForce 6100 VGA Driver v.304.51 Certified,How Can You Update & Download NVidia GeForce 9300/nForce 730i VGA Driver v.310.19 Certified,Method to Download NVidia GeForce GT 330M Driver v.340.65,How Can I Update & Download NVidia GeForce GTX 590 Driver v.280.26 WHQL,Method to Download NVidia Tesla C2050 Driver v.319.17