HI all!,
i was asked to make the files to load in the excel more robust. Meaning the excel has to be able to load two files of different name and format to produce an output. keeping in mind format as in the the way the file is named. i have tried to do some codes myself but it would not load unless both their names or their format are the same. not sure where i go wrong as i am quite new to the VBA scene. hope someone would help me out! below is my code that i wrote.
Sub loadone() 'load data for input1
Application.Calculation = xlManual
Application.ScreenUpdating = False
Call clearinputone
Dim inputone As String, columnIndexOne As Integer
inputone = Application.GetOpenFilename("Calc Files (*.cal), *.cal") 'windows explorer + select .cal file
If "" <> inputone Then
columnIndexOne = 2
Call loadFileOne(inputone, columnIndexOne)
Worksheets("Tool").range("B6").Value = inputone 'displays file path and name
Call loadtwo
Call nameformat
Exit Sub
End If
Application.Calculation = xlCalculationAutomatic
Application.Calculate
Application.ScreenUpdating = True
End Sub
i was asked to make the files to load in the excel more robust. Meaning the excel has to be able to load two files of different name and format to produce an output. keeping in mind format as in the the way the file is named. i have tried to do some codes myself but it would not load unless both their names or their format are the same. not sure where i go wrong as i am quite new to the VBA scene. hope someone would help me out! below is my code that i wrote.
Sub loadone() 'load data for input1
Application.Calculation = xlManual
Application.ScreenUpdating = False
Call clearinputone
Dim inputone As String, columnIndexOne As Integer
inputone = Application.GetOpenFilename("Calc Files (*.cal), *.cal") 'windows explorer + select .cal file
If "" <> inputone Then
columnIndexOne = 2
Call loadFileOne(inputone, columnIndexOne)
Worksheets("Tool").range("B6").Value = inputone 'displays file path and name
Call loadtwo
Call nameformat
Exit Sub
End If
Application.Calculation = xlCalculationAutomatic
Application.Calculate
Application.ScreenUpdating = True
End Sub