Search This Blog
Sunday, 17 August 2014
CALCULATE SHIFT HOURS FROM SHIFT WINDOW (START TIME AND END TIME)
Say, you are given shift timings ( shift start time and shift end time) and you need to calculate shift hours from them. Below is the formula for that.
Formula in B2:
=MOD(RIGHT(A2,5)-LEFT(A2,5),1)*24 and drag it down.
Friday, 14 September 2012
RESTRICT USER TO MOVE YOUR USERFORM
Use below codes to restrict the users to move your userform.
1) Declare variables
Private m_sngAnchorLeft As Single
Private m_sngAnchorTop As Single
Private m_blnSetAnchor As Boolean
2) Paste the below code in the Activate event of the userform
Private Sub UserForm_Activate()
If Me.Visible Then
If Not m_blnSetAnchor Then
m_sngAnchorLeft = Me.Left
m_sngAnchorTop = Me.Top
m_blnSetAnchor = True
End If
End If
End Sub
3) Paste the below code in the Deactivate event of the userform
Private Sub UserForm_Deactivate()
m_blnSetAnchor = False
End Sub
4) Paste the below code in the Layout event of the userform
Private Sub UserForm_Layout()
If m_blnSetAnchor Then
Me.Left = m_sngAnchorLeft
Me.Top = m_sngAnchorTop
End If
End Sub
1) Declare variables
Private m_sngAnchorLeft As Single
Private m_sngAnchorTop As Single
Private m_blnSetAnchor As Boolean
2) Paste the below code in the Activate event of the userform
Private Sub UserForm_Activate()
If Me.Visible Then
If Not m_blnSetAnchor Then
m_sngAnchorLeft = Me.Left
m_sngAnchorTop = Me.Top
m_blnSetAnchor = True
End If
End If
End Sub
3) Paste the below code in the Deactivate event of the userform
Private Sub UserForm_Deactivate()
m_blnSetAnchor = False
End Sub
4) Paste the below code in the Layout event of the userform
Private Sub UserForm_Layout()
If m_blnSetAnchor Then
Me.Left = m_sngAnchorLeft
Me.Top = m_sngAnchorTop
End If
End Sub
Note: All the above codes should be used
DISABLE CLOSE("X") BUTTON OF USERFORM
To disable the close(X) button of userform paste the below code on the QueryClose event of your userform.
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then
Cancel = True
MsgBox "The X is disabled, please use a button on the form.", vbCritical
End If
End Sub
Sunday, 19 August 2012
CREATE FUNNEL CHART USING FORMULA
Following are the Steps:
1. Sort your data in Descending Order
2. Enter formula in C2 =REPT("|",B2/50) and drag it down
3.Choose the color that you want.
Friday, 17 August 2012
FIND OUT MAXIMUM OCCURED TEXT IN A RANGE
Array formula in B2:
=INDEX($A$2:$A$9,MATCH(MAX(COUNTIF($A$2:$A$9,$A$2:$A$9)),COUNTIF($A$2:$A$9,$A$2:$A$9),0)) with CSE
Subscribe to:
Posts (Atom)




