Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
edwardpestian
 
Posts: n/a
Default Date Button


I need a button that when pressed inserts today's date in a specific
cell - only if its less than today's date or blank. If its already
today's date, then do nothing. I have the following code that I've used
to insert the date upon opening a workbook, but I can't seem to get it
to work attached to a button..

Private Sub Workbook_Open()
Dim cell As Range
Set cell = Worksheets("Sheet1").Range("A1")
If cell.Text = "" Then
cell.Value = Date
End If
End Sub

Thanks.


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile: http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=556384

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel: Toolbar button for Formatting cells to date STYLES etc Pauline from Perth Aus. Setting up and Configuration of Excel 0 June 6th 06 03:46 AM
Recurring annual events using a specific date as a trigger date Bamboozled Excel Worksheet Functions 1 June 6th 05 01:44 PM
date format problem Nigel Excel Discussion (Misc queries) 7 May 11th 05 12:57 PM
Adding a control button to insert a date in the active cell. Mike Excel Discussion (Misc queries) 2 February 15th 05 06:27 PM
Macro to simply bring up the Find dialogue box?? marika1981 Excel Discussion (Misc queries) 14 January 14th 05 10:47 PM


All times are GMT +1. The time now is 09:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"