LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default This is not working because I didn't write it correctly

Unfortunatly, I am also not experienced enough to figure out what I have
done wrong. Please take a look at this horrible code and tell me what I have
done wrong.

The point of this is to automatically update information when the workbook
is opened. This is a time off tracking sheet. there is a master blank copy
used for creating new sheets. A census form that is a repository for other
general informatoin for all employees. Vac&Sick sheet is an index similiar
to the census form. Each remaining sheet is the individuals record fo time
taken off.

Thanks for helping and if you have any questions let me know. By the way,
this started with another thread but I have lost it somehow. For whatever
reason I am unable to access my old thread. Sorry for any confusion or
reposting that has occured.
LWhite

Sub Workbook_Open()
Dim wks As Worksheet
For Each wks In ActiveWorkbook.wks
' pick an employee record to evaluate rather than the master and system
sheets
'
If LCase(wks.Name) = LCase("master") Then
' do nothing
Else
If LCase(wks.Name) = LCase("employee census") Then
' do nothing
Else
If LCase(wks.Name) = LCase("vac&sick") Then
' do nothing
Else

' Determine if the employee uses the first of the year or not

If ActiveSheet.Range("C5").Value DateSerial(2005, 1, 1) Then
' if they do then do the copy/move
If Range("A99").Value 0 Then
Range("A7:F34").Select
Selection.Copy
ActiveWindow.SmallScroll Down:=66
Range("A100").Select
ActiveSheet.Paste
ActiveWindow.SmallScroll Down:=-75
Range("A8:F34").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("A99").Value = 1
End If
Else
' if not then determine if the copy should be done or not
If ActiveSheet.Range("C5").Value DateSerial(Now - 1, Range("C5"),
Range("C5")) Then
If Range("A99").Value 0 Then
Range("A7:F34").Select
Selection.Copy
ActiveWindow.SmallScroll Down:=66
Range("A100").Select
ActiveSheet.Paste
ActiveWindow.SmallScroll Down:=-75
Range("A8:F34").Select
Application.CutCopyMode = False
Selection.ClearContents
Range("A99").Value = 1
End If
End If
End If
End If
End If
End If

Next wks
End Sub


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro not working correctly Andy_N1708 via OfficeKB.com Excel Discussion (Misc queries) 3 May 27th 10 03:35 AM
VLookup is not working correctly Eric @ BP-EVV Excel Worksheet Functions 3 July 18th 08 12:24 AM
Hyperlink not working correctly DonnaO Excel Discussion (Misc queries) 0 November 20th 07 10:45 AM
Formulas not working correctly Curt D. Excel Worksheet Functions 6 November 1st 07 08:48 PM
How to write this correctly? Michael[_27_] Excel Programming 5 September 20th 04 11:51 PM


All times are GMT +1. The time now is 11:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"