ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding a date to a cell (https://www.excelbanter.com/excel-programming/277631-adding-date-cell.html)

CBG

Adding a date to a cell
 
Hello,
How can I add a date to a cell?
I have tried
Worksheets("Sheet1").Range("A1").Value = Now
But I keep getting a subscript out of range error message.
Please help!
Thanks. :-)
Consuelo

Gord Dibben

Adding a date to a cell
 
Consuelo

Perhaps you have no Sheet1 ?

Gord Dibben Excel MVP XL2002

On Sat, 20 Sep 2003 19:21:44 -0700, "CBG" wrote:

Hello,
How can I add a date to a cell?
I have tried
Worksheets("Sheet1").Range("A1").Value = Now
But I keep getting a subscript out of range error message.
Please help!
Thanks. :-)
Consuelo



M. lane

Adding a date to a cell
 
Click the cell you wish to contain the automatic date entry, type
=NOW()
or
=TODAY()
See which one works best for you.


"CBG" wrote in message
...
Hello,
How can I add a date to a cell?
I have tried
Worksheets("Sheet1").Range("A1").Value = Now
But I keep getting a subscript out of range error message.
Please help!
Thanks. :-)
Consuelo




Tom Ogilvy

Adding a date to a cell
 
Just a little addition/elaboration to Gordon's excellent advice:

Given your line of code, the only thing that could cause that message would
be if you don't have a sheet with a tab name of Sheet1. It might be Sheet
1 (with a space after sheet) or it could be sheet1, but contain one or more
spaces tacked on at the front or the back of the name. Try renaming the
sheet so you are sure it is named sheet1 with no spaces.

--
Regards,
Tom Ogilvy

CBG wrote in message
...
Hello,
How can I add a date to a cell?
I have tried
Worksheets("Sheet1").Range("A1").Value = Now
But I keep getting a subscript out of range error message.
Please help!
Thanks. :-)
Consuelo





All times are GMT +1. The time now is 10:48 PM.

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