开发者

Putting today's date in blank cells

I woul开发者_StackOverflow中文版d like a macro that puts today's date into all blank cells within a column. If there is a date already in then a cell, then it should skip this row.


You can do this without VBA, see http://www.contextures.com/xlDataEntry02.html

With code as requested (select your range to populate prior to running)

Sub QuickFill()
Dim rng1 As Range
On Error Resume Next
Set rng1 = Selection.SpecialCells(xlBlanks)
On Error GoTo 0
If Not rng1 Is Nothing Then rng1.Value = Format(Now(), "dd-mmm-yy")
End Sub
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜