And when I'm referring to "old timers", I'm referring to users, not the developers. Why would a user need to understand that snippet? Are we even talking about the same thing?
> "C6:G6"
I think the bigger problem is it's not going to be a developer maintaining this. It's going to be a pretty literate VBA user and nothing will go wrong. Inevitably they will move on and pass over the code, the 'user application' to someone who will feel reassured they can read it too, but then when it comes time to make a change, they won't be able to. And then it'll be passed over again and become a black box.
A developer (if there's funding) will not like picking up something undocumented, then it becomes a project (less funding). The process, a magical black box that may or may not have stopped working also loses documentation. Governance is lost. Particularly but not exclusively in financial applications, potential for misuse and loss, either accidentally or fraudulently, has been introduced.
So, the above looks (mainly) OK to me. But only because I know to insist on maintaining a manual backup or otherwise maintaining knowledge of how the black box works.
See basically "no dev needed", perfect for old timers who can't code. Or not.
private void placeAnOrder() { listSheet.unprotect(""); Range costCell = spreadsheet.getRangeByName(exchangeSheet.getSheetId(), COST_CELL); if (!costCell.toString().isEmpty()) { Double cost = costCell.getRangeValue().getCellValue().getDoubleValue(); if (cost > 0) { Double amount = spreadsheet.getRangeByName(exchangeSheet.getSheetId(), "amount").getRangeValue().getCellValue().getDoubleValue(); Range orderTable1stRow = spreadsheet.getRange(BOOK_NAME, listSheet.getSheetId(), "C6:G6"); orderTable1stRow.getEntireRow().insert(Range.InsertShiftDirection.ShiftDown, Range.InsertFormatOrigin.RightOrBelow); orderTable1stRow.setValues(DateUtil.getExcelDate(new Date()), cost, destinationCurrency, destinationRate, amount); } } listSheet.protect(PROTECTION); }