Categories

Change file extensions

Public Function ChangeExtension(ByVal FolderName As String, _
ByVal NewExtension As String, Optional ByVal OldExtension As _
String = “”) As Boolean

Dim oFso As New FileSystemObject
Dim oFolder As Folder
Dim oFile As File
Dim sOldName As String
Dim sNewName As String
Dim iCtr As Long
Dim iDotPosition As Integer
Dim sWithoutExt As String
Dim sFolderName As String

sFolderName = FolderName
If Right(sFolderName, 1) [...]

Calculates age in years from a given date to today’s date.

Function Age(varBirthDate As Variant) As Integer

Dim varAge As Variant
if not isDate(varBirthDate) then Exit Function
varAge = DateDiff(“yyyy”, varBirthDate, Now)
If Date < DateSerial(Year(Now), Month(varBirthDate), _
[...]

calculate someones age

Function CalcAge(datEmpDateOfBirth As Variant) As Integer
CalcAge = Int(DateDiff(“y”, CDate(datEmpDateOfBirth), Date) / 365.25)
End Function

Bookmark It

box gradient effect

Sub BoxGradient(frm As Form, rs%, gs%, bs%, re%, ge%, be%, size%, smooth As Boolean)
If frm.WindowState = vbMinimized Then Exit Sub
size = size + 2
If smooth = True Then
frm.DrawStyle = 6
Else
[...]

Blink a label

Place a label and a timer on a form , set the timers interval to about 250.

Enter the following code

Private Sub Timer1_Timer()

Label1.Caption = “Blinking label effect”
If Label1.Visible = True Then
Label1.Visible = False
Else
Label1.Visible = True
End If

End Sub

Bookmark It