Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Default Date: Today

Hi,

I am very new to both Excel and VBA. How do I set a cell
to default to today's date, and another cell to default to
7 days before today?

Thanks,
C.M.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Default Date: Today

Cathy,

Use
=TODAY()
and
=TODAY()-7

If you want to use VBA, use

Range("A1").Value = Format(Now,"mm/dd/yyyy")
and
Range("A2").Value = Format(Now-7,"mm/dd/yyyy")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Cathy Myers" wrote in message
...
Hi,

I am very new to both Excel and VBA. How do I set a cell
to default to today's date, and another cell to default to
7 days before today?

Thanks,
C.M.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Default Date: Today

Hi,

to get todays date

= TODAY()
7 days before today
=TODAY()-7

Abdul Salam



-----Original Message-----
Hi,

I am very new to both Excel and VBA. How do I set a cell
to default to today's date, and another cell to default

to
7 days before today?

Thanks,
C.M.
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Default Date: Today

range("A1").Value = date
range("A2").Value = date - 7

Tritan

-----Original Message-----
Hi,

I am very new to both Excel and VBA. How do I set a cell
to default to today's date, and another cell to default

to
7 days before today?

Thanks,
C.M.
.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Default Date: Today

Hi Chip,

Thank you. I will try it and let you know how it turns out.

Yours,
C.M.

-----Original Message-----
Cathy,

Use
=TODAY()
and
=TODAY()-7

If you want to use VBA, use

Range("A1").Value = Format(Now,"mm/dd/yyyy")
and
Range("A2").Value = Format(Now-7,"mm/dd/yyyy")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Cathy Myers" wrote in message
...
Hi,

I am very new to both Excel and VBA. How do I set a cell
to default to today's date, and another cell to default

to
7 days before today?

Thanks,
C.M.



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Default Date: Today

Thanks

C.M.

-----Original Message-----
Hi,

to get todays date

= TODAY()
7 days before today
=TODAY()-7

Abdul Salam



-----Original Message-----
Hi,

I am very new to both Excel and VBA. How do I set a cell
to default to today's date, and another cell to default

to
7 days before today?

Thanks,
C.M.
.

.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Default Date: Today

Hey Chip,

Thank you so much! I inserted the code into my Auto_Open
sub routine, and it worked like a dream!

Yours,
C.M.


-----Original Message-----
Cathy,

Use
=TODAY()
and
=TODAY()-7

If you want to use VBA, use

Range("A1").Value = Format(Now,"mm/dd/yyyy")
and
Range("A2").Value = Format(Now-7,"mm/dd/yyyy")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Cathy Myers" wrote in message
...
Hi,

I am very new to both Excel and VBA. How do I set a cell
to default to today's date, and another cell to default

to
7 days before today?

Thanks,
C.M.



.

Reply
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
change date in excel from today to original date of file Nelson Excel Discussion (Misc queries) 1 September 18th 09 08:33 AM
Date Formula for number of days between a date and today BrendaP Excel Discussion (Misc queries) 7 July 2nd 09 07:30 PM
IF TODAY equals date in cell A10, or if TODAY is beyond that date SoupNazi Excel Worksheet Functions 4 April 23rd 07 01:14 AM
MAX figure within a date range as a function of today()'s date irvine79 Excel Worksheet Functions 6 February 20th 07 03:28 PM
SUMIF within date range as a function of today()'s date irvine79 Excel Worksheet Functions 8 August 6th 06 05:55 PM


All times are GMT +1. The time now is 06:59 AM.

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

About Us

"It's about Microsoft Excel"