ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Paste year as a specific date (https://www.excelbanter.com/excel-programming/415691-paste-year-specific-date.html)

Patrick C. Simonds

Paste year as a specific date
 
Can anyone think of a way in which someone could enter a number
(representing a year, say 2009) and then paste the results into cell A1 as
January 1 of that year?


Patrick C. Simonds

Paste year as a specific date
 
What this should say is:

Can anyone think of a way in which someone could enter a number in a
TextBox (representing a year, say 2009) and then paste the results into cell
A1 as
January 1 of that year?

"Patrick C. Simonds" wrote in message
...
Can anyone think of a way in which someone could enter a number
(representing a year, say 2009) and then paste the results into cell A1 as
January 1 of that year?



Rick Rothstein \(MVP - VB\)[_2580_]

Paste year as a specific date
 
Something like this maybe...

Range("A1").Value = DateSerial(TextBox1.Value, 1, 1)

Rick


"Patrick C. Simonds" wrote in message
...
What this should say is:

Can anyone think of a way in which someone could enter a number in a
TextBox (representing a year, say 2009) and then paste the results into
cell A1 as
January 1 of that year?

"Patrick C. Simonds" wrote in message
...
Can anyone think of a way in which someone could enter a number
(representing a year, say 2009) and then paste the results into cell A1
as January 1 of that year?




Patrick C. Simonds

Paste year as a specific date
 
Yes, thank you

"Rick Rothstein (MVP - VB)" wrote in
message ...
Something like this maybe...

Range("A1").Value = DateSerial(TextBox1.Value, 1, 1)

Rick


"Patrick C. Simonds" wrote in message
...
What this should say is:

Can anyone think of a way in which someone could enter a number in a
TextBox (representing a year, say 2009) and then paste the results into
cell A1 as
January 1 of that year?

"Patrick C. Simonds" wrote in message
...
Can anyone think of a way in which someone could enter a number
(representing a year, say 2009) and then paste the results into cell A1
as January 1 of that year?






All times are GMT +1. The time now is 06:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com