M
maperalia
I have a macro which calls “lst†files under specific directory (see macro
below).
Most of the time, the data is not typed accordingly to call the “lst†files.
I wonder if I can get a window message to tell me that "MAKE SURE DATA
TYPED ON CELLS C3, C5 AND C6 MATCH WITH LAB DATA".
Thanks in advance.
Maperalia
Sub List_lst_Files1()
Const basicPath = "S:\GEOTEST\shears\"
Const listSheetName = "List of lst Files"
Dim anyFileName As String
Dim searchFor As String
Dim rOffset As Long
Dim listBaseCell As Range
Application.ScreenUpdating = False
searchFor = basicPath & _
Worksheets("DEFAULTS").Range("C3").Value & "\" & _
Worksheets("DEFAULTS").Range("C5").Value & "*" & _
Worksheets("DEFAULTS").Range("C6").Value & "*.lst"
anyFileName = Dir$(searchFor)
Do While anyFileName <> ""
listBaseCell.Offset(rOffset, 0) = anyFileName
rOffset = rOffset + 1
anyFileName = Dir$ ' gets next match for original 'mask'
Loop
Set listBaseCell = Nothing ' release resource
Application.ScreenUpdating = False
End Sub
below).
Most of the time, the data is not typed accordingly to call the “lst†files.
I wonder if I can get a window message to tell me that "MAKE SURE DATA
TYPED ON CELLS C3, C5 AND C6 MATCH WITH LAB DATA".
Thanks in advance.
Maperalia
Sub List_lst_Files1()
Const basicPath = "S:\GEOTEST\shears\"
Const listSheetName = "List of lst Files"
Dim anyFileName As String
Dim searchFor As String
Dim rOffset As Long
Dim listBaseCell As Range
Application.ScreenUpdating = False
searchFor = basicPath & _
Worksheets("DEFAULTS").Range("C3").Value & "\" & _
Worksheets("DEFAULTS").Range("C5").Value & "*" & _
Worksheets("DEFAULTS").Range("C6").Value & "*.lst"
anyFileName = Dir$(searchFor)
Do While anyFileName <> ""
listBaseCell.Offset(rOffset, 0) = anyFileName
rOffset = rOffset + 1
anyFileName = Dir$ ' gets next match for original 'mask'
Loop
Set listBaseCell = Nothing ' release resource
Application.ScreenUpdating = False
End Sub