Command Button code - for 'Today()'

Good evening all

I am after some simple code to apply to a CommandButton1_Click(),
where when the button is clicked, today's date is inserted into the active cell.
(Though I do require this date to then be fixed, and not change the following day)

Any help most appreciated.
Thank you
Mathew


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.551 / Virus Database: 343 - Release Date: 11/12/2003
0
mpb1 (60)
12/12/2003 5:57:53 PM
excel.misc 78881 articles. 5 followers. Follow

2 Replies
429 Views

Similar Articles

[PageSpeed] 12

Mathew here is one way

Selection = Date

-- 
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 97 & 2000
** remove news from my email address to reply by email **

"Mathew P Bennett" <mpb1@btinternet.com> wrote in message
news:brcvj1$nub$1@sparta.btinternet.com...
> Good evening all
>
> I am after some simple code to apply to a CommandButton1_Click(),
> where when the button is clicked, today's date is inserted into the active
cell.
> (Though I do require this date to then be fixed, and not change the
following day)
>
> Any help most appreciated.
> Thank you
> Mathew
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.551 / Virus Database: 343 - Release Date: 11/12/2003


0
pbridgesnews (182)
12/12/2003 6:15:07 PM
Mathew,

Why not use Ctrl-;, no code required?

-- 

HTH

Bob Phillips
    ... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Mathew P Bennett" <mpb1@btinternet.com> wrote in message
news:brcvj1$nub$1@sparta.btinternet.com...
> Good evening all
>
> I am after some simple code to apply to a CommandButton1_Click(),
> where when the button is clicked, today's date is inserted into the active
cell.
> (Though I do require this date to then be fixed, and not change the
following day)
>
> Any help most appreciated.
> Thank you
> Mathew
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.551 / Virus Database: 343 - Release Date: 11/12/2003


0
bob.phillips1 (6510)
12/12/2003 6:41:53 PM
Reply:

Similar Artilces:

List Box Command and Filter Criteria
Hello, I've a list box for which I've multiple filters. I'd like to add another criterion for one of the filters. Here is the code: DocList.RowSource = "SELECT tbl_main.ID, tbl_main.DocumentID, tbl_main.DocumentTitle, tbl_main.ReleaseDate, tbl_main.Version, tbl_main.Valid FROM tbl_main Where (((tbl_main.DocumentID) Like '*PL*')) ORDER BY tbl_main.DocumentID" Along with '*PL*', I'd like to add '*CMP*' so that it gives me both PL and CMP records. I tried: DocList.RowSource = "SELECT tbl_main.ID, tbl_main.DocumentID, ...

Voting Buttons Not Showing
Using Outlook 2003, I've created and published a customer satisfaction form. The form contains Voting Buttons I want users to be able to open the form and respond by clicking on the appropriate button. Replies are sent to a designated mailbox. I have one problem: the voting buttons don't appear, when the form is opened from the published location.(i.e. Organisational Forms Library or Personal Forms library) Interestingly, if users open the form and send it to themselves, then the voting buttons do appear? What am I doing wrong please? I'd like to be able to see ...

Problem w/custom Macro Buttons on move to Laptop
In Excel 2000 on my WinXP Pro computer I had custom macro buttons that when clicked executed the VBA code in my personal.xls file. The excel.xlb was located in c:\Documents and Setting\comp1\Application Data\Excel and the personal.xls file was located in "c:\Documents and Setting\comp1\Application Data\Excel\Xlstart". On my new laptop with Win XP Home I reinstalled Excel 2000 and put the excel.xlb file in c:\Documents and Setting\Laptop\Application Data\Excel and put the personnal.xls file into c:\Documents and Setting\Laptop\Application Data\Excel\Xlstart On the laptop when I bri...

Trouble with my Lookup Code
Hi Everyone. I’m adding a cost lookup to my db, based on the example in the Tradewinds database. I am trying to add a “CostPerFoot” value to the form automatically, based on the “MaterialType” entered by the user. Both of these fields are maintained in the “MaterialCostTable”. Here is what my ‘after update’ looks like on the “Material Type” field of the entry form: Private Sub MaterialType_AfterUpdate() On Error GoTo Err_MaterialType_AfterUpdate Dim strFilter As String ' Evaluate filter before it's passed to DLookup function. strFilter = "MaterialType =...

Code working ? in Access 2007
Why does some code I have created in Earlier version of Access Not work in Access 2007....?????? -- LD What code? How much earlier? Are the proper object library references set? What do you mean by "not work"? Error messages? (which ones), nothing happens? unexpected things happen? nothing happens? There are probably an infinite number of answers to your very broad question. If you'd like to provide more information, someone might be willing to assist. If your question was rhetorical, have a nice weekend. -- HTH, George "LD" <LD@discussions.microsoft.com&...

control command
My Control command has stopped funtioning to allow me to select a group of non adjacent cells in Excle. Both control keys? If you swap out keyboards, do you still have the problem? mtvlgl wrote: > > My Control command has stopped funtioning to allow me to select a group of > non adjacent cells in Excle. -- Dave Peterson Have you checked that the CNTRL key is working outside of Excel? May be the keyboard is broken. -- Gary's Student "mtvlgl" wrote: > My Control command has stopped funtioning to allow me to select a group of > non adjacent cells in Ex...

How do I reverse this code??
This code loses focus of textbox when user types and presse commandbutton1 Private Sub CommandButton1_Click() Me.TextBox1.Enabled = CBool(Me.TextBox1.Value = "") End Sub Using Commandbutton2.... how do I reverse this code??? Private Sub CommandButton2_Click() ?????????????????????????????? End Sub -Larry- VBA Amateu -- Message posted from http://www.ExcelForum.com Me.TextBox1.Enabled = True never mind... GOT IT! -- Message posted from http://www.ExcelForum.com ...

coding practice / refresher
It's been a while since I've used C++ (background in Delphi and C# as of late) and I have some general coding practice questions. (I'm using VS 6 C++ with MFC). 1) is it considered bad form to return a newly allocated variable from a function, as in the following, and is this considered "on the heap"? char *whatever(int parm) { char *result = new char[parm]; return result; } 2) how do you free the memory associated with the above function call once you're done, i.e., there's no garbage collection as in C# where I can just set the var to null, right? ...

Customized Toolbar RestoreState() fails if it has only 1 button
This issue happens only when the numbers of buttons in the tool bar is "1". Thats is, the user launches the customize toolbar dialog and removes all but 1 tool bar button. I have multiple Tool bars which I persist on application close and restore on application load. The SaveState() works fine as I notice the value "55 81 00 00" saved if only 1 button is left in the Tool bar. Here is the code for the RestoreState for (int i = 0; i < m_ToolBars.GetSize(); i++) { HKEY hSecKey = AfxGetApp()->GetSectionKey("Tool Bars"); if (hSecKey == NULL) break; CS...

Collapse / Expand formula bar button from Excel
Hello How can I have a button like the 'Expand Fromula Bar' one in Microsoft Office Excel 2007 in my application ? The Excel button I want is to the far right end of the formula bar of an Excel workbook. I would like it to the right end of my toolbar, where clicking it would expand the toolbar much like the Excel formula bar expands when clicking it, but how do I get the button ? Thank you, Timothy Madden On Feb 17, 11:56=A0am, Timothy Madden <terminato...@gmail.com> wrote: > Hello > > How can I have a button like the 'Expand Fromula Bar' o...

Remove a Macro Code
I have the following code that: when pressing "Ctrl+E" runs a macro (called "Prepare_External") that runs the below code. This code protects all the worksheets, hides one particular sheet called "Input" and then protects the workbook. But before I protect the workbook I want to delete the macro "Prepare_External" so it cannot be run again. How can I do this? ' Keyboard Shortcut: Ctrl+e Sub Prepare_External() Dim ws As Worksheet For Each ws In ThisWorkbook.Worksheets ws.Protect Password:="password" Next ws ActiveWorkbook.Worksheets("...

How to set up custom buttons in MS windows explorer
Hi I am writing a simple application to set up custom button control in MS windows explorer... Its like I shall be clicking on the button control and it shall be activating my custom program on the files/directories currently under selection... Having searched through a lot of MSDN stuff,, i could not find a way good enought to support me in my programming... Kindly suggest what needs to be done.... I am building this application in Microsoft Visual C++ using MFC... Also my platform is X86 with Windows 2000 Thanks in advance.. Regards, a.a.cpp ...

Adding Industry Codes
I am picking up the pieces on a previous installation of CRM, and want to add additional industries to my industry dropdown in the Lead form. For the life of me, I can't find the proper table in the database. Can someone be good enough to point me in the right direction? Thanks, Chris Chris, You don't do this via a table, you need to do it via form customization. You will need system admin rights, then go into System Customization and modify the Lead form. After making the changes, you will need to publish the change via Deployment Manager and issue an IISRESET. Matt "Chris...

How to set time for processing the code?
Does anyone have any suggestions on how to set time for processing the code? I would like to add a condition that allow process the code before 4 pm, Does anyone have any suggestions on how to do it? Thanks in advance for any suggestions Eric If FileDateTime(PathFileName) > Date + TimeSerial(8, 0, 0) Or Now < TimeSerial(16, 0, 0) Then {It does not work!} hi i think the ontime method might do better. see this site for more details http://www.cpearson.com/excel/OnTime.aspx regards FSt1 "Eric" wrote: > Does anyone have any suggestions on how to set ...

Clean Up Code
Hi All... I have code that contains the following: ActiveCell.FormulaR1C1 = "USB" Range("A2").Select ActiveCell.FormulaR1C1 = "04165" Range("A3").Select ActiveCell.FormulaR1C1 = "14709" Range("A4").Select ActiveCell.FormulaR1C1 = "14716" Range("A5").Select ActiveCell.FormulaR1C1 = "24704" Range("A6").Select ActiveCell.FormulaR1C1 = "44705" Range("A7").Select ActiveCell.FormulaR1C1 = "44710" and it goes on to ent...

how do i recognize the figure button on excel
In article <E796C509-C8E0-4276-A376-949111F877F0@microsoft.com>, =?Utf- 8?B?bmVlZCBoZWxw?= <need help@discussions.microsoft.com> says... > > It's got the figure on it? -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions ...

please i need help with undo??? command+Z
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel excuse for my bad englsh but i need help... <br> when i working in a pc with windows i can do many undo as i need but in my mac with excel i only can do 16. i need more..pleasse let me now if i can add more undo???? <br><br>undo is (command + Z)... <br><br>please help me...... If you had more than 16 Undo actions you must have been using Excel in Office 2007 or the 2010 Beta. No other versions of Excel -- for PC or Mac -- support more than 16 & there is nothing that can be ...

Installing Outlook Trusted Code Control
I have Outlook Pro 2003. Can I install the Outlook Trusted Code Control so I have access to Outlook Security Template? Currenty I am unable to find the Hashctl.dll file to install and register the Trusted Code Control. Maybe I am doing something wrong. .. Help appreciated. Bill ...

Customizing Outlook Today #7
I am having trouble with Customizing Outlook Today. In a nut shell, nothing happens when I click on the link. I have uninstalled and reinstalled Outlook. I always get a number of errors during the installation process: 1. Error 1919. Error configuring ODBC data source: MS Access Database, ODBC error 6: Component not found in registry. Verify that the file MS Access Database exists and that you can access it. 2. Error 1919. Error configuring ODBC data source: dBASE files, ODBC error 6: Component not found in registry. Verify that the file dBASE files exists and that y...

send button #5
I am trying the Outllok program...I am used to the Outlook EXPRESS. Attempting to send ane-mail, I have no "sned" button - I am unable to send an e-mail. How come? After you write the email, you do not see a SEND button to the far left of the screen ? If not, RIGHT click on the toolbar and make sure that the STANDARD formatting box is checked, if not check it and you will get another toolbar with the send and other commands on it Tedd -- Tedd Riggs PDASquare Content Developer www.pdasquire.com "Joni" <anonymous@discussions.microsoft.com> wrote in message news:33...

VB Editor
This is driving me crazy; I hope someone can help.<br> <br> When I'm in the Visual Basic editor, if I press any letter that has a command key assignment, it performs that action as if Cmd were pressed - if I press "g", it opens the Immediate window. If I press "r", it goes to the Object Browser. If I press "s", it saves my document. It's impossible to actually type anything!<br> <br> This is only happening in the VB Editor, it's happening in the editor in both Word and Excel, and it happens whether it's in an existing file o...

Buttons for Macros #2
Hi, Ive created some simple Macros that print sheets in my workbook. Which is all fine, but I will be sending the spreadsheet out to people who will not have a clue how to use a macro. Currently Im using Ctrl+x to do it, but............ I want to create a button on the worksheet that they can press with their mouse to activate the Macro. Is this possible - Im sure Ive seen it somewhere. Thanks. -- Ainsley ------------------------------------------------------------------------ Ainsley's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=31960 View this threa...

Slow Response When Clicking on " New " Button
When I go to create a new email using the " New" button located right under the " file " tab and proceed to click on it..there is a long delay before it actually opens up the window for me to compose the email...it spins for about 3 seconds..give or take.Please help. ...

Add a refresh button to the Account Summary window
At present if you are working with the Account Summary window open in GL and make a posting to an account that has already been viewed and then try to view the data, the Final totals are updated and correct but the Period totals are not. I suggest a refresh button is added to the window to recalculate the Period figures when required so that all figures displayed by the window are correct. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the mess...

Switch Company button doesn't work
Hi Everybody, We have a new install of GP on a computer on which neither the button on the tool bar with the company name nor the File->User and Company menu item do anything at all. The install has the same hotfixes and add ons that the other copies do, but only on this one does this occur. The problem occurs on multiple users. Does anyone have any ideas? Thanks, Jeremy My first thought would be check security for the window, button, or task. Does thie company switching work for the 'sa' user? What about Power users? Are users granted access to the companies? When lo...