This code is opening two excel files, takes from each one the sum of a column and then put them in two cells in the original file. My code opens the files as they are already defined, but I want the script to ask me what files I want to choose.
Workbooks.Open Filename:="G:\Users\K.os\Desktop\roxana\m.xls"
Windows("roxana.xlsm").Activate
Workbooks.Open Filename:="G:\Users\K.os\Desktop\roxana\p.xls"
Windows("roxana.xlsm").Activate
Range("A4").Select
ActiveCell.FormulaR1C1 = "=SUM([m.xls]All!C25)"
Range("A5").Select
ActiveCell.FormulaR1C1 = "=SUM([m.xls]All!C28)"
Range("B4").Select
ActiveCell.FormulaR1C1 = "=SUM([p.xls]Treiro!C21)"
Range("B5").Select
ActiveCell.FormulaR1C1 = "=SUM([p.xls]Treiro!C23)"
Windows("p.xls").Activate
ActiveWindow.Close
Windows("m.xls").Activate
ActiveWindow.Close
Range("C4").Select
ActiveCell.FormulaR1C1 = "=IF(EXACT(RC[-2],RC[-1]),""identice"",""greseala"")"
Range("C5").Select
ActiveCell.FormulaR1C1 = "=IF(EXACT(RC[-2],RC[-1]),""identice"",""greseala"")"