Currently working on a script for indexing a hard drive, and entering data into a "Document Type" column (Column I in this case) based on keywords in the documents. What I currently have works perfectly, but takes forever as it sometimes can be upwards of 10,000 files. Is there an easier way that provides the same results?
If InStr(1, objFile.Name, "Cheese", vbTextCompare) > 0 Then
.Offset(i, 9) = "A Files"
ElseIf InStr(1, objFile.Name, "Gouda", vbTextCompare) > 0 Then
.Offset(i, 9) = "A Files"
ElseIf InStr(1, objFile.Name, "Havarti", vbTextCompare) > 0 Then
.Offset(i, 9) = "A Files"
ElseIf InStr(1, objFile.Name, "Birch", vbTextCompare) > 0 Then
.Offset(i, 9) = "Tree Files"
ElseIf InStr(1, objFile.Name, "Willow", vbTextCompare) > 0 Then
.Offset(i, 9) = "Tree Files"
ElseIf InStr(1, objFile.Name, "Maple", vbTextCompare) > 0 Then
.Offset(i, 9) = "Tree Files"
ElseIf InStr(1, objFile.Name, "Kings", vbTextCompare) > 0 Then
.Offset(i, 9) = "NHL Teams that will win the stanley cup files"
ElseIf InStr(1, objFile.Name, "LA", vbTextCompare) > 0 Then
.Offset(i, 9) = "NHL Teams that will win the stanley cup files"
I've changed the names for example purposes, haha.
Bookmarks