Sub Macro1()
Dim ER As Long
ER = ThisWorkbook.ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
Dim Cell As Range
Dim CriteriaRange As Range
Set CriteriaRange = ThisWorkbook.ActiveSheet.Range("A3:A" & ER)
For Each Cell In CriteriaRange
If InStr(1, "H04C", vbTextCompare) = 1 Then 'I am trying to see if the string H04C exists within column A, and if so, do things'
File_name = ActiveCell.Value
Path_Name = ActiveCell.Offset(columnOffset:=5).Value
Workbooks.Open Filename:=File_name
End If
Next Cell
End Sub
Anyone have any ideas?
Dim ER As Long
ER = ThisWorkbook.ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
Dim Cell As Range
Dim CriteriaRange As Range
Set CriteriaRange = ThisWorkbook.ActiveSheet.Range("A3:A" & ER)
For Each Cell In CriteriaRange
If InStr(1, "H04C", vbTextCompare) = 1 Then 'I am trying to see if the string H04C exists within column A, and if so, do things'
File_name = ActiveCell.Value
Path_Name = ActiveCell.Offset(columnOffset:=5).Value
Workbooks.Open Filename:=File_name
End If
Next Cell
End Sub
Anyone have any ideas?