I inherited a macro and need to make updates, please bear with me.
Public Const strSourceFolder1 As String = "\\File_Path\Sub_Folder2"
Public Const strSourceFolder2 As String = "\\File_Path\Sub_Folder1"
I have 8 strings such as those above. I'd like make these into an array that I can reference throughout my procedures. Is this possible? What would forming the array look like? The "File_Path" is the location of a folder containing documents to be manipulated by the macro, my goal here is only to update my source folder to a set of folders.
I tried the FoldersArray, but I got a type mismatch when I reference it in this part of my macro:
Private Sub GetFileName()
Dim wb As Workbook
Dim ws As Worksheet
Dim FileName As String
Dim Path As String
Dim lngRow As Long
Set wb = ActiveWorkbook
Set ws = ActiveSheet
lngRow = 2
Path = FolderArray & "*.*"
FileName = Dir(Path, vbNormal)
Do Until FileName = ""
Application.DisplayAlerts = False
Sheet1.Cells(lngRow, 1).Select
Sheet1.Cells(lngRow, 1) = FileName
Call MainExtractData(FileName, lngRow)
lngRow = lngRow + 1
FileName = Dir()
Loop
End Sub