PC Review


Reply
Thread Tools Rate Thread

Changing dates with a macro

 
 
scary boy
Guest
Posts: n/a
 
      31st Aug 2004
I have a list of 7 dates, any Monday - Sunday, and I want to write a
macro, that when run, will change the first date to 7 days in the
future, and then have all the other dates respond to the change in the
first date.

I have taken an unused cell, and added 7 to the first date, but when i
copy, or drag to the original cell, it either gives a #REF or the
other cells wont respond.

I write my macros by stepping through the processes. I don't know
enough to actually write one using the visual basic language.

A B C
1 8/30 Mon
2 +A1+1 =A2 <--- (formatted for day of the week)
3 +A2+1
4 +A3+1
5 etc.....
6
7
Thanks in advance. I appreciate the help.
Fred Roach
(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      1st Sep 2004
You could use a line like:

with worksheets("sheet1").range("a1")
.value = .value + 7
end with

(This didn't do any validation at all!)



scary boy wrote:
>
> I have a list of 7 dates, any Monday - Sunday, and I want to write a
> macro, that when run, will change the first date to 7 days in the
> future, and then have all the other dates respond to the change in the
> first date.
>
> I have taken an unused cell, and added 7 to the first date, but when i
> copy, or drag to the original cell, it either gives a #REF or the
> other cells wont respond.
>
> I write my macros by stepping through the processes. I don't know
> enough to actually write one using the visual basic language.
>
> A B C
> 1 8/30 Mon
> 2 +A1+1 =A2 <--- (formatted for day of the week)
> 3 +A2+1
> 4 +A3+1
> 5 etc.....
> 6
> 7
> Thanks in advance. I appreciate the help.
> Fred Roach
> (E-Mail Removed)


--

Dave Peterson
(E-Mail Removed)
 
Reply With Quote
 
scary boy
Guest
Posts: n/a
 
      1st Sep 2004
On Tue, 31 Aug 2004 18:07:04 -0500, Dave Peterson <(E-Mail Removed)>
wrote:

>with worksheets("sheet1").range("a1")
> .value = .value + 7
> end with



Dave -- that worked perfectly -- thanks so much.
quick response too, i really appreciate it.
fred roach
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop UK-style dates changing to US-style dates when mailmerging. Jean XO Microsoft Excel Misc 1 20th Dec 2007 12:35 PM
dates changing! darre77 Microsoft Excel Discussion 2 25th Mar 2006 10:00 AM
changing dates =?Utf-8?B?TGtpZGQ=?= Microsoft Excel New Users 1 5th Oct 2004 12:26 AM
Change Start Dates without Changing Due Dates Beth Microsoft Outlook Discussion 0 19th Aug 2004 03:44 PM
Changing to new dates =?Utf-8?B?QWxp?= Microsoft Excel Misc 5 8th Feb 2004 03:10 AM


Features
 

Advertising
 

Newsgroups
 


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