I was wondering if there was a way to have an array that only has the quantity of indexes necessary, when you are not sure how many indexes it will need.
It's my understanding that you have to declare how many indexes an array will have before using it, however in this code (which I didn't write) it seems that the array is not declared at all. Can somebody explain what is going on in this code with the variable "ExcelFilePath"?
It's my understanding that you have to declare how many indexes an array will have before using it, however in this code (which I didn't write) it seems that the array is not declared at all. Can somebody explain what is going on in this code with the variable "ExcelFilePath"?
Code:
Sub Compress_Raw_Data()
ExcelFilePath = Application.GetOpenFilename(FileFilter:="CSV (Comma delimited) (*.csv), *.csv", _
Title:="Select a file or files", _
MultiSelect:=True)
If VarType(ExcelFilePath) = vbBoolean Then
MsgBox (" You have not selected any file")
Exit Sub
End If
For fnum = LBound(ExcelFilePath) To UBound(ExcelFilePath)
'PURPOSE: Find & Replace text/values throughout entire workbook
Workbooks.Open Filename:=ExcelFilePath(fnum)
Dim sht As Worksheet
For Each sht In ActiveWorkbook.Worksheets
sht.Columns("A").NumberFormat = "mm/dd/yyyy hh:mm:ss.0"
Next sht
ActiveWorkbook.Close True
Next fnum
End Sub