我应该如何继续将Sub Proper()
Dim ws As Object
Dim LCell As Range
'Move through each sheet in your spreadsheet
For Each ws In ActiveWorkbook.Sheets
' Convert all constants and text values to proper case
For Each LCell In Cells.SpecialCells(xlConstants, xlTextValues)
LCell.Value = Application.WorksheetFunction.Proper(LCell)
Next
Next ws
End Sub
类型值转换为小时制表示。
std::chrono::minutes::rep
答案 0 :(得分:5)
minutes::rep time = 4; std::cout << time; // outputs as minutes, need in hours
因为time
只是一个(实现定义的)整数类型,它与minutes
或hours
无关,并且对基础时间表示没有任何了解
您希望留在duration
领域:
minutes time{4};
auto as_hours = std::duration_cast<hours>(time);
std::cout << as_hours.count(); // prints 0
或者,可能:
auto as_hours_dbl = std::duration_cast<duration<double, hours::period>>(time);
std::cout << as_hours_dbl.count(); // prints 0.0666667