ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel Help (https://www.excelbanter.com/excel-discussion-misc-queries/241037-excel-help.html)

scott

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

Eduardo

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


Gord Dibben

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




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com