I want to take some datas from another file in excel to come to my main file, I have no problem at all with this code:
Sub Call() ' ' Call Macro ' ' ActiveCell.FormulaR1C1 = _ "=IF(('C:\Users\prosp\Documents\Kabu\[Book1.xlsx]Sheet1'!R[1]C[-1])-('C:\Users\prosp\Documents\Kabu\[Book1.xlsx]Sheet1'!R[1]C[-4])=0,""0"",('C:\Users\prosp\Documents\Kabu\[Book1.xlsx]Sheet1'!R[1]C[-1])-('C:\Users\prosp\Documents\Kabu\[Book1.xlsx]Sheet1'!R[1]C[-4]))" Range("F4").Select End Sub But if the file's type change to .csv file, I can't call the datas which I want to use. The code was like this:
Sub Call() ' ' Call Macro ' ' ActiveCell.FormulaR1C1 = _ "=IF(('C:\Users\prosp\Documents\Kabu\[Book1.csv]Sheet1'!R[1]C[-1])-('C:\Users\prosp\Documents\Kabu\[Book1.csv]Sheet1'!R[1]C[-4])=0,""0"",('C:\Users\prosp\Documents\Kabu\[Book1.csv]Sheet1'!R[1]C[-1])-('C:\Users\prosp\Documents\Kabu\[Book1.csv]Sheet1'!R[1]C[-4]))" Range("F4").Select End Sub How can I call the .csv file with that code? Is there anyone who can help me please?