I want to open one or more Excel files from a folder.
The macro should check if the value from three different cells are not zero.
If not, macro should open the file based on the cell value.
How do I open multiple files based on cell value?
Public Sub OpenFile1(MyRow, MyCol+1)
If Cells(MyRow, MyCol+1).Value <> "" Then
Workbooks.Open Path & Name
End If
End Sub
Public Sub OpenFile2(MyRow, MyCol+2)
If Cells(MyRow, MyCol+2).Value <> "" Then
Workbooks.Open Path & Name
End If
End Sub
Public Sub OpenFile3(MyRow, MyCol+3)
If Cells(MyRow, MyCol+3).Value <> "" Then
Workbooks.Open Path & Name
End If
End Sub
Sub openbutton1()
Call OpenFile1(6, 36)
Call OpenFile2(6, 36)
Call OpenFile3(6, 36)
End Sub