Skip to content

Instantly share code, notes, and snippets.

Private sArray
Dim Dic As Object
Private Sub UserForm_Initialize()
Set Dic = CreateObject("Scripting.Dictionary")
sArray = S2.Range("A1:D" & S2.[A65536].End(xlUp).Row).Value
LBDMHH.List() = sArray
Sub WaitFor(NumOfSeconds As Single)
Dim SngSec As Single
SngSec = Timer + NumOfSeconds
Do While Timer < SngSec
DoEvents
Loop
End Sub
Function FilterMCLArray(ByVal sArray, ByVal TotalCol As Long, ByVal FindStr As String, ByVal HasTitle As Boolean)
Dim tmpArr, i As Long, j As Long, ColIndex As Long, K As Long, Arr, Dic, TmpStr, Tmp, Chk As Boolean, TmpVal As Double
On Error Resume Next
Set Dic = CreateObject("Scripting.Dictionary")
tmpArr = sArray
Function Filter2DArray(ByVal sArray, ByVal ColIndex As Long, ByVal FindStr As String, ByVal HasTitle As Boolean)
Dim tmpArr, i As Long, j As Long, Arr, Dic, TmpStr, Tmp, Chk As Boolean, TmpVal As Double
On Error Resume Next
Set Dic = CreateObject("Scripting.Dictionary")
tmpArr = sArray
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
With Target
If .Row > 1 And .Count = 1 And .Column = 1 And .Value = "" Then
FrmDMHH.Show
End If
End With
Cancel = False
End Sub
Private Sub cbSetText_Click()
MsgBox myTextbox.Value
End Sub
Private Sub myTextbox_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Select Case KeyAscii
Case Is < vbKey0, Is > vbKey9
KeyAscii = 0
Beep
End Select
End Sub
Sub MergeSheets()
Dim x As Integer
Dim ws As Worksheet
On Error GoTo ErrHandler
Application.ScreenUpdating = False
x = 1
For Each ws In ThisWorkbook.Sheets
If ws.Name <> "Tong Hop" Then
Function Reversestr(str As String) As String
Reversestr = StrReverse(Trim(str))
End Function
Function fCount(strPath)
Dim fCnt As Integer
fCnt = ShowFolderList(strPath)
fCount = fCnt
End Function
Sub CntFiles()
Dim strPath As String
strPath = "A:\Asif\Answers\abc"
ShowFolderList (strPath)
Function CountFilesInFolder(strDir As String, Optional strType As String)
Dim file As Variant, i As Integer
If Left(strDir, 1) <> "\" Then strDir = strDir & "\"
file = Dir(strDir & strType)
While (file <> "")
i = i + 1
file = Dir
Wend
CountFilesInFolder = i
End Function