![]() |
current date
Hi All
I use Excel 2003 SP2 and have two question: 1. I try to set function "=year(date())" in control source property of a textbox but I recive an error to use invalid property why? 2. I need get current date and minus 20 days and show it in a textbox with this formt 04-JAN-2009? Thanks in advance Bijan |
current date
On Sun, 4 Jan 2009 08:17:01 -0800, bijan
wrote: Hi All I use Excel 2003 SP2 and have two question: 1. I try to set function "=year(date())" in control source property of a textbox but I recive an error to use invalid property why? 2. I need get current date and minus 20 days and show it in a textbox with this formt 04-JAN-2009? Thanks in advance Bijan Try this formula in the linked cell: =TEXT(TODAY()-20,"DD-MMM-YYYY") Hope this helps / Lars-Åke |
current date
I would just use
=TODAY()-20 and format the cell as required so as to leave a true date in the cell. -- __________________________________ HTH Bob "Lars-Åke Aspelin" wrote in message ... On Sun, 4 Jan 2009 08:17:01 -0800, bijan wrote: Hi All I use Excel 2003 SP2 and have two question: 1. I try to set function "=year(date())" in control source property of a textbox but I recive an error to use invalid property why? 2. I need get current date and minus 20 days and show it in a textbox with this formt 04-JAN-2009? Thanks in advance Bijan Try this formula in the linked cell: =TEXT(TODAY()-20,"DD-MMM-YYYY") Hope this helps / Lars-Åke |
current date
Oops, missed the textbox point.
-- __________________________________ HTH Bob "Bob Phillips" wrote in message ... I would just use =TODAY()-20 and format the cell as required so as to leave a true date in the cell. -- __________________________________ HTH Bob "Lars-Åke Aspelin" wrote in message ... On Sun, 4 Jan 2009 08:17:01 -0800, bijan wrote: Hi All I use Excel 2003 SP2 and have two question: 1. I try to set function "=year(date())" in control source property of a textbox but I recive an error to use invalid property why? 2. I need get current date and minus 20 days and show it in a textbox with this formt 04-JAN-2009? Thanks in advance Bijan Try this formula in the linked cell: =TEXT(TODAY()-20,"DD-MMM-YYYY") Hope this helps / Lars-Åke |
current date
Hi,
You haven't told us where your text box is - is it in the spreadsheet or on a VBA form. Suppose it's on a user form (VBA) then Private Sub UserForm_Initialize() Me.TextBox1 = Format(Date-20, "dd-mmm-yyyy") End Sub -- If this helps, please click the Yes button Cheers, Shane Devenshire "bijan" wrote: Hi All I use Excel 2003 SP2 and have two question: 1. I try to set function "=year(date())" in control source property of a textbox but I recive an error to use invalid property why? 2. I need get current date and minus 20 days and show it in a textbox with this formt 04-JAN-2009? Thanks in advance Bijan |
All times are GMT +1. The time now is 08:55 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com