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

I need help creating a small macro. When activated, I want an input box to
come up asking "Week Beginning" & "Week Ending" and fill those dates into
a2:a26 (essentially 5 times) ie:

1/1/2005
1/1/2005
---
---
1/5/2005
1/5.2005

Can someone help me out?

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Simple Table

Sorry. I was looking at this all wrong. What I need instead is a way to
just add 7 days to a date thats already in the cell. How do i do that?

"Dominique Feteau" wrote in message
...
I need help creating a small macro. When activated, I want an input box to
come up asking "Week Beginning" & "Week Ending" and fill those dates into
a2:a26 (essentially 5 times) ie:

1/1/2005
1/1/2005
---
---
1/5/2005
1/5.2005

Can someone help me out?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Simple Table

Define a variable as date and you can simply do addition substraction
like normal maths.

E.g.
1. Below code will display 7 days after current date
MsgBox Date + 7

2. Below code assumes that a valid date is already in Cell A2, and puts
a date of 7 days later in to cell A3. It shows how to assign the dates
to date variables.

Dim myDate As Date, myNewDate As Date

myDate = Worksheets("Sheet1").Range("A2")
myNewDate = myDate + 7
Worksheets("Sheet1").Range("A3") = myNewDate

3. Same as above but without using any variable
Worksheets("Sheet1").Range("A3") = Worksheets("Sheet1").Range("A2") + 7

Sharad

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
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
Simple Pivot Table question - I'm stumped jay g Excel Discussion (Misc queries) 1 January 10th 07 07:45 AM
Simple Calculation within pivot table toryc Excel Worksheet Functions 0 October 19th 06 10:51 PM
Help with simple data table? Stevie New Users to Excel 3 January 28th 06 03:53 PM
How do you create formulas in pivot table eg simple division? Belinda_Tim Excel Worksheet Functions 2 January 5th 06 03:03 PM
Simple table query Bryan Linton Excel Programming 2 August 5th 04 04:05 PM


All times are GMT +1. The time now is 11:23 PM.

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"