Jestli je to excel, pak použij přímo funkce excelu.ActiveSheet.Range("B1").Value = WorkSheetFunction.Max(Range("A1:A10"))