#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 577
Default Excel Help

Not sure if I'm in the right area, but I have two questions to ask.

First, is there a way to use a "code" to distinguish between different parts
of the day with the Excel office 'Page Setup Header' funtion? What I'm
trying to do is have something say: if it is '4:30p.m.', then it is '2nd
shift'.

Second one, is there a way to have an input box to sign in before the user
opens a file? If so, is there also a way to save there 'login name' onto the
form that they print out or save as a file?

Thank you in advance.
Scott
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,276
Default Excel Help

Hi Scott,
to your first question an excellent place to look at is CPearson web, if you
go to the end of the page you will find even more links to other related
subjets

http://www.cpearson.com/excel/overtime.htm

Regarding to your 2nd question take a look at Debra web

http://contextures.com/xlUserForm01.html
http://contextures.com/xlUserForm02.html

if this helps please click yes, thanks


"Scott" wrote:

Not sure if I'm in the right area, but I have two questions to ask.

First, is there a way to use a "code" to distinguish between different parts
of the day with the Excel office 'Page Setup Header' funtion? What I'm
trying to do is have something say: if it is '4:30p.m.', then it is '2nd
shift'.

Second one, is there a way to have an input box to sign in before the user
opens a file? If so, is there also a way to save there 'login name' onto the
form that they print out or save as a file?

Thank you in advance.
Scott

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Excel Help

I have assumed that first shift ends at 4:00PM and you are on a network with
users logging in.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim MyTime
MyTime = #4:00:00 PM#
With ActiveSheet
If Time MyTime Then
.PageSetup.CenterFooter = Environ("username") & " second shift"
End If
End With
End Sub


Private Sub Workbook_BeforeSave(ByVal SaveAsUI _
As Boolean, Cancel As Boolean)
Dim MyTime
MyTime = #4:00:00 PM#
With ActiveSheet
If Time MyTime Then
.PageSetup.CenterFooter = Environ("username") & " second shift"
End If
End With
End Sub

Copy/paste these......or whichever one you want......to Thisworkbook module.

Note: Environ("username") is the login name.

Second one.............in order for an inputbox to appear, the file must
already have been opened.

If you are looking to prevent unauthorized users from opening the workbook,
simply password to open the workbook.

If all you're looking for is a record of login name, the above will suffice.


Gord Dibben MS Excel MVP



On Fri, 28 Aug 2009 11:05:01 -0700, Scott
wrote:

Not sure if I'm in the right area, but I have two questions to ask.

First, is there a way to use a "code" to distinguish between different parts
of the day with the Excel office 'Page Setup Header' funtion? What I'm
trying to do is have something say: if it is '4:30p.m.', then it is '2nd
shift'.

Second one, is there a way to have an input box to sign in before the user
opens a file? If so, is there also a way to save there 'login name' onto the
form that they print out or save as a file?

Thank you in advance.
Scott


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



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

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

About Us

"It's about Microsoft Excel"