Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 125
Default Time Sheet Macro

Hi,

me try to follow a rule for all the employees of in my concern.

e.g., Working Hrs for all the employee is 9:30hrs to 18:45hrs. If any
one works till 20:30hrs in a day he or she can resume his next day's
duty by 10:30hrs in the mornining. But if he or she has work less than
20:30 hrs then he has resume his duty from 9:30hrs in the morning. To
ascertain this i created an excel sheets.

All the Columns (C1,E1,G1,I1,K1,M1,O1,P1....) has got time In
All the Columns (D1,F1,H1,J1,L1,N1,P1,Q1....) has got time out.

Now i want that if D1 is greater than or equal to 20:30 hrs it should
automatically becomes Bold otherwise it should be in normal fonts
(without Bold). Moreover if D1 greater than 20:30hrs then E1 can have
data in normal font only till 10:30hrs. As soon as the user enters
data greater than 10:30hrs in D1 it should automatically change the
font color in Red with strikethrough.

This would continue in all the cell (D1,F1,H1,J1,L1,N1,P1,Q1....)

How can this be possible.

I dont want to run macro all the time. It should work autometically in
the back end.

Awaiting for your reply.

Thanks

Akash

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Time Sheet Macro

On Jun 25, 2:04 pm, Akash wrote:
Hi,

me try to follow a rule for all the employees of in my concern.

e.g., Working Hrs for all the employee is 9:30hrs to 18:45hrs. If any
one works till 20:30hrs in a day he or she can resume his next day's
duty by 10:30hrs in the mornining. But if he or she has work less than
20:30 hrs then he has resume his duty from 9:30hrs in the morning. To
ascertain this i created an excel sheets.

All the Columns (C1,E1,G1,I1,K1,M1,O1,P1....) has got time In
All the Columns (D1,F1,H1,J1,L1,N1,P1,Q1....) has got time out.

Now i want that if D1 is greater than or equal to 20:30 hrs it should
automatically becomes Bold otherwise it should be in normal fonts
(without Bold). Moreover if D1 greater than 20:30hrs then E1 can have
data in normal font only till 10:30hrs. As soon as the user enters
data greater than 10:30hrs in D1 it should automatically change the
font color in Red with strikethrough.

This would continue in all the cell (D1,F1,H1,J1,L1,N1,P1,Q1....)

How can this be possible.

I dont want to run macro all the time. It should work autometically in
the back end.

Awaiting for your reply.

Thanks

Akash


try playing with worksheet_change in the worksheet module. as the
value in the intercept changes, the worksheet automatically excecutes
the code. the following code will work for the data in columns, not in
rows, as you currently have them.

maybe something like this (you'll need to double check it, but here's
the general idea):

Private Sub Worksheet_Change(ByVal Target As Range)

Dim target_address As String


If Intersect(Target, Range("D1:D100")) Is Nothing Then
Exit Sub
Else
'check to make sure the target (hours
inputed) is numeric and greater than 20:30
'you may need to enter the hours as 20.5
instead of 20:30 to calculate things. I'm just using 20.5 in the
example

If (IsNumeric(Target) = True) And (Target
20.5) Then
'make the number bold
Target.select
Selection.Font.Bold = True
end if

'set E1 to normal only after 10.5 hours
'if E1 has data greater than 10.5 hours,
make red.
Range("E1").select
if (selection 10.5)
'make red

Selection.Font.ColorIndex = 3
end if

end if


hope that helps get you started in the right direction

  #3   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 65
Default Time Sheet Macro

Take a look at
http://www.j-walk.com/ss/excel/files/timesht.htm

Ed

  #4   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default Time Sheet Macro

I would just use conditional formatting. No need to use macros for this.
--
JNW


"Akash" wrote:

Hi,

me try to follow a rule for all the employees of in my concern.

e.g., Working Hrs for all the employee is 9:30hrs to 18:45hrs. If any
one works till 20:30hrs in a day he or she can resume his next day's
duty by 10:30hrs in the mornining. But if he or she has work less than
20:30 hrs then he has resume his duty from 9:30hrs in the morning. To
ascertain this i created an excel sheets.

All the Columns (C1,E1,G1,I1,K1,M1,O1,P1....) has got time In
All the Columns (D1,F1,H1,J1,L1,N1,P1,Q1....) has got time out.

Now i want that if D1 is greater than or equal to 20:30 hrs it should
automatically becomes Bold otherwise it should be in normal fonts
(without Bold). Moreover if D1 greater than 20:30hrs then E1 can have
data in normal font only till 10:30hrs. As soon as the user enters
data greater than 10:30hrs in D1 it should automatically change the
font color in Red with strikethrough.

This would continue in all the cell (D1,F1,H1,J1,L1,N1,P1,Q1....)

How can this be possible.

I dont want to run macro all the time. It should work autometically in
the back end.

Awaiting for your reply.

Thanks

Akash


Reply
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
Time Sheet - Calculating Time Differences for Totals Kathy Excel Discussion (Misc queries) 3 January 14th 10 10:04 PM
Macro Printing One Sheet with one change at a time JohnHB Excel Discussion (Misc queries) 0 February 6th 07 04:57 PM
Detailed Time Sheet (overtime, comp time, vacation used) Robert D. Sandersfeld New Users to Excel 2 May 22nd 06 10:14 PM
How do I time Hours & mins in excel - Time sheet Helen Excel Discussion (Misc queries) 5 September 17th 05 11:42 AM
I need a time sheet template that verifies time entered against sy Bob Powell Excel Discussion (Misc queries) 1 April 19th 05 03:11 PM


All times are GMT +1. The time now is 01:16 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"