0
A
回答
2
把folling到模块: 对于这项工作,我们需要存储用户的初始设置公共变量。这将需要投入Module
不是Object
Option Explicit
Public InternationalDateSetting As XlApplicationInternational
然后把这个到ThisWorkbook
对象。当用户打开工作簿时,它会将用户设置设置为公共变量。然后,在此用户停用工作簿时(即更改为其他工作簿或其他程序),它会将用户设置重置为默认设置,然后在用户激活工作簿时将其更改为您的自定义设置。在这一过程中,将控制应用程序的设置,但要具体工作簿
Option Explicit
Private Sub Workbook_Open()
InternationalDateSetting = Application.International(xlMDY)
End Sub
Private Sub Workbook_Activate()
'' Please look at https://msdn.microsoft.com/en-us/library/office/ff840213.aspx for all settings
'' Set to true for month-day-year order, false for day-month-year
Application.International(xlMDY) = True
'' Or uncomment and use:
'' 0 = month-day-year
'' 1 = day-month-year
'' 2 = year-month-day
'' You will also need to change the Workbook_Open and Workbook_Deactivate from 'xlMDY' to 'xlDateOrder'
' Application.International(xlDateOrder) = 0
End Sub
Private Sub Workbook_Deactivate()
Application.International(xlMDY) = InternationalDateSetting
End Sub
相关问题
- 1. 区域设置在Excel
- 2. Rails i18n区域设置和区域
- 3. Java DecimalFormatter - 区域设置DE和区域设置US
- 4. Xcode 7 UI测试目标区域设置和区域设置
- 5. Excel宏 - 动态设置打印区域
- 6. 区域设置和ISO3CountryCodes
- 7. Response.write和区域设置
- 8. Java和Windows区域设置
- 9. Sharepoint - 区域设置
- 10. MKMapView设置区域
- 11. Sharepoint区域设置
- 12. 黑莓设置剪辑区域/区域
- 13. java区域设置getDisplayLanguage缺少一些区域设置
- 14. CakePHP 2.4和Timehelper的timeAgoInWords区域设置
- 15. 日期格式和区域设置
- 16. python区域设置货币和负数
- 17. CurrentUICulture忽略区域和语言设置
- 18. Unicode和区域设置问题
- 19. xlwings - 获取和设置命名区域
- 20. SSRS CreateSubscription - 设置区域设置
- 21. 如何设置全局区域设置?
- 22. 如何设置error.po的区域设置?
- 23. 访问CultureInfo设置(区域设置)?
- 24. 设置区域设置 - 俄语
- 25. 使用DefaultHttpClient设置区域设置?
- 26. Facebook获取区域设置
- 27. 检查区域设置
- 28. 设置可用区域
- 29. 在MKMapView设置区域
- 30. 区域设置链接
您的区域设置设置为MM/DD/YYYY,但你然后格式化细胞DD/MM/YYYY。选择一个,但改变它们以使它们匹配。 – CLR
是的,但我可以强制excel不读区域设置? – PDS
您可以使用'Application.International(xlCountrySetting)'来更改工作簿的区域设置吗? – Tom