bdouglas1011
New Member
- Joined
- Jul 28, 2014
- Messages
- 38
This code looks at 2 columns 1 column has files listed from a folder the next column one of the files will has "YES" in it ...so the code selects the file that is to the left of the YES
The range with file names is (CC30:CC43)other rows from the path cell. The column that has the yes in it is Range (CL30:CL43)
tried getting rid of the col & row parts but could not make it work
The range with file names is (CC30:CC43)other rows from the path cell. The column that has the yes in it is Range (CL30:CL43)
tried getting rid of the col & row parts but could not make it work
VBA Code:
path = cells(i + 30, 81)
'If Right(path, 1) <> "\" Then path = path + "\"
'setting up the generic name for unformatted surveys, "path\<Well Name> Surveys.csv"
Dim unformatSvy As String: unformatSvy = path + Range("G10").Text + " Surveys.csv"
'Find the file marked as the survey file then exit loop
For i = row + 2 To row + 15
If cells(i, col + 11).Value = "Yes" Then
path = path + cells(i, col + 2).Text
Exit For
End If
Next i