用按钮插入今天的日期,作为日期,不是功能? [英] Insert today's date with button, as date, not function?

查看:102
本文介绍了用按钮插入今天的日期,作为日期,不是功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  ActiveCell.FormulaR1C1 == NOW()
ActiveCell.Offset( 1,0).Range(A1)。选择

但是, code> = NOW(),而不是日期。



我想按下按钮,并获得 2015-03-13 ,而当我明天打开表格时,应该还是说> 2015-03-13 。

解决方案

考虑:

  ActiveCell.Value = Now 


I use this VBA:

ActiveCell.FormulaR1C1 = "=NOW()"
ActiveCell.Offset(1, 0).Range("A1").Select

But the value of the cell becomes =NOW(), not the date.

I want to push the button and get 2015-03-13, and when I open the sheet tomorrow, it should still say 2015-03-13.

解决方案

Consider:

ActiveCell.Value=Now

这篇关于用按钮插入今天的日期,作为日期,不是功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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