This file contains hidden or 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
| Public Function IsArrayUnique(tArr As Variant) As Boolean | |
| Dim out As Boolean, tOut As Double | |
| Dim i As Long | |
| For Each t In tArr | |
| If Len(t) > 0 Then | |
| tOut = WorksheetFunction.Match(CStr(t), tArr, 0) | |
| If WorksheetFunction.IsError(tOut) Then | |
| out = False | |
| Else |
This file contains hidden or 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
| Public Function ColumnNumberToLetter(colNum As Long) As String | |
| ColumnNumberToLetter = Split(Cells(1, colNum).Address, "$")(1) | |
| End Function |
This file contains hidden or 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
| Public Function ArrayElements_1D(arrInput As Variant) As Integer | |
| ArrayElements_1D = UBound(arrInput, 1) - LBound(arrInput) + 1 | |
| End Function |
This file contains hidden or 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
| 'Create .xlsb file | |
| Public Function RunWorkbookCreate(urlHistData As String, Optional CloseDirectly As Boolean = True) As Workbook | |
| Dim newWbook As Workbook | |
| Set newWbook = Workbooks.Add | |
| newWbook.SaveAs Filename:=urlHistData, FileFormat:=50 | |
| Debug.Print "WbCREATE: " & newWbook.FullName | |
| Set RunWorkbookCreate = newWbook | |
This file contains hidden or 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 FileSize(path As String) As Variant | |
| FileSize = FileLen(path) | |
| End Function |
This file contains hidden or 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 BulkDownloads() | |
| Dim i As Long, FileNum As Long, lrow As Long, headRow As Long | |
| Dim FileData() As Byte | |
| Dim MyFile As String, DownloadedDir As String | |
| Dim WHTTP As Object | |
| Dim ws As Excel.Worksheet | |
| On Error Resume Next | |
| Set WHTTP = CreateObject("WinHTTP.WinHTTPrequest.5") | |
| If Err.Number <> 0 Then |
This file contains hidden or 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 FileExist(path As String) As Boolean | |
| If Dir(path) <> vbNullString Then FileExist = True | |
| End Function |
This file contains hidden or 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
| Public Sub main() | |
| Dim xDir As String | |
| Workbooks("combined_list.xlsm").Activate | |
| xDir = Range("root_url").Value | |
| Call ExtractExcelContents(xDir, True) | |
| End Sub | |
| Private Sub ExtractExcelContents(ByVal xFolderName As String, ByVal xIsSubfolders As Boolean) | |
| Dim xFileSystemObject As Object, xFolder As Object, xSubFolder As Object |
This file contains hidden or 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 MainList() | |
| Dim xDir As String | |
| xDir = Range("root_url").Value | |
| 'MsgBox xDir | |
| Call clearList | |
| Application.ScreenUpdating = False | |
| Call ListFilesInFolder(xDir, True) | |
| Application.ScreenUpdating = True | |
| MsgBox "All files has been listed" |
This file contains hidden or 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
| Public Sub LoopShading() | |
| Dim c As Range, bottomA As Long, curr As String, prev As String | |
| Dim currColor As String, prevColor As String, tempcolor As String | |
| bottomA = Range("A" & Rows.Count).End(xlUp).Row | |
| currColor = "blue" | |
| prevColor = "orange" | |
| prev = "010-F-31001" | |
| For Each c In Range("A2:A" & bottomA) | |
| curr = c |