Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在宏中使用excel函数?
我想提取日期格式的月份:
k = Application.WorksheetFunction.Month(Selection.Value)
这不应该工作吗?
当像 MONTH 这样的工作表函数具有与 VBA 完全等效的本机函数时,它不能通过 Application.WorksheetFunction 获得,您必须使用本机 VBA 函数,如 Siddarth 所示
k=Month(Selection.Value)