AndyLitch's blog

Response 2 to Need help to gather staff times

Martin,

two files attached. MD master is the file which collates the data from the timesheets. TS1 is a timesheet. Note I have amended the timesheet format slightly so this will need to become your new template timesheet (see notes).
I recommend you error check for mathematical errors before deploying.
The master workbook also has a populateallrnd macro which will populate all timesheet workbooks within a folder with random numbers.
Any probs/questions email me at andrewlitchfield@gmail.com for fine tweaking

Calculating Binomial Coefficients with Excel

Attached is a simple spreadsheet for calculating linear and binomial coefficients using Excel

Getting the hard drive serial number

 Function HdNum() As String

    Dim fsObj   As Object

    Dim drv     As Object

    Set fsObj = CreateObject("Scripting.FileSystemObject")

    Set drv = fsObj.Drives("C")

    HdNum = Hex(drv.serialnumber)

End Function

Sub HD()

    MsgBox HdNum

End Sub

 

Since each computers hdd serial number is unique this can be useful for security

Demo Scrolling Message display using a chart

Just a bit of fun to demo how you can create a scrolling dot matrix message display using a bit of VBA and charts.

Sub DotMatrix()
Dim lngIndex As Long

ColourNum = 3
ColourSelect

DispState = Sheet2.CheckBox1.Value
Sheet2.CheckBox1.Value = True

Sheet2.Range("C58").Value = 1
'Exit Sub
With Worksheets("LCD")
For lngIndex = 0 To (Len(.Range("DISPLAYTEXT").Value) * 6) Step 1
.Range("SLICE").Value = lngIndex
Range("C2").Select
DoEvents
Next

Syndicate content