捕获日期的运行时错误 [英] catching runtime errors for dates

查看:117
本文介绍了捕获日期的运行时错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

请在下方帮助我,

我有一个excel中的日期格式化列,我们必须输入日期值手册,然后一个VBA脚本将处理它并且必须将日期值放在另一个Excel工作表中。

I have a date formatted column in excel, there we have to enter the date values manual then one VBA script will process it and have to place the date values in another excel sheet.

这里,作为日期手动输入,会有一些拼写错误(例如:2/1617而不是2/16 / 17,2-1-201而不是2-1-2016)。请帮助我使用VBA代码来捕捉这种拼写错误。

here, as the date is manually entered, there will be some typos (ex: 2/1617 instead of 2/16/17, 2-1-201 instead of 2-1-2016). please help me with VBA code to catch this kind of typos.

推荐答案

使用VBA.IsDate检查一个单元格是否包含真正的日期。

Use VBA.IsDate to check if a cell contains really a date.

Andreas。


这篇关于捕获日期的运行时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆