This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub WaitFor(NumOfSeconds As Single) | |
Dim SngSec As Single | |
SngSec = Timer + NumOfSeconds | |
Do While Timer < SngSec | |
DoEvents | |
Loop | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Reversestr(str As String) As String | |
Reversestr = StrReverse(Trim(str)) | |
End Function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |