PC Review


Reply
Thread Tools Rate Thread

Date addition/format

 
 
gjameson via OfficeKB.com
Guest
Posts: n/a
 
      13th Feb 2007
I have a button on my ss that I want to use to create a new worksheet. The
catch is that I want the name to be a date cell plus 14 days. Here is what I
have so far.

Sub Save_New_Tab_Click()
Worksheets.Add After:=Worksheets(Worksheets.Count)
Worksheets(Worksheets.Count).Name = Format((Range("A2").Value + 14), Date,
"mm_dd_yyyy")

End Sub

A2 has my date in this format mm/dd/yyyy. add 14 days to get worksheet name
in format mm_dd_yyyy. This has been driving me crazy all afternoon. What am I
doing wrong?

TIA
Gerald

--
Message posted via http://www.officekb.com

 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      13th Feb 2007
Sub Save_New_Tab_Click()
Worksheets.Add After:=Worksheets(Worksheets.Count)
Worksheets(Worksheets.Count).Name = Format((Range("A2").Value + 14),
"mm_dd_yyyy")
End Sub

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"gjameson via OfficeKB.com" <u21717@uwe> wrote in message
news:6dc3364fbea6c@uwe...
>I have a button on my ss that I want to use to create a new worksheet. The
> catch is that I want the name to be a date cell plus 14 days. Here is what
> I
> have so far.
>
> Sub Save_New_Tab_Click()
> Worksheets.Add After:=Worksheets(Worksheets.Count)
> Worksheets(Worksheets.Count).Name = Format((Range("A2").Value + 14),
> Date,
> "mm_dd_yyyy")
>
> End Sub
>
> A2 has my date in this format mm/dd/yyyy. add 14 days to get worksheet
> name
> in format mm_dd_yyyy. This has been driving me crazy all afternoon. What
> am I
> doing wrong?
>
> TIA
> Gerald
>
> --
> Message posted via http://www.officekb.com
>



 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      13th Feb 2007
Sorry, that should be

Sub Save_New_Tab_Click()
Worksheets.Add(After:=Worksheets(Worksheets.Count)).Name = _
Format((Range("A2").Value + 14), "mm_dd_yyyy")
End Sub


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"gjameson via OfficeKB.com" <u21717@uwe> wrote in message
news:6dc3364fbea6c@uwe...
>I have a button on my ss that I want to use to create a new worksheet. The
> catch is that I want the name to be a date cell plus 14 days. Here is what
> I
> have so far.
>
> Sub Save_New_Tab_Click()
> Worksheets.Add After:=Worksheets(Worksheets.Count)
> Worksheets(Worksheets.Count).Name = Format((Range("A2").Value + 14),
> Date,
> "mm_dd_yyyy")
>
> End Sub
>
> A2 has my date in this format mm/dd/yyyy. add 14 days to get worksheet
> name
> in format mm_dd_yyyy. This has been driving me crazy all afternoon. What
> am I
> doing wrong?
>
> TIA
> Gerald
>
> --
> Message posted via http://www.officekb.com
>



 
Reply With Quote
 
Fred Smith
Guest
Posts: n/a
 
      14th Feb 2007
What you are doing wrong is giving Format 3 parameters, when it is looking for
only two. Take out the " Date," from your Format function.

--
Regards,
Fred


"gjameson via OfficeKB.com" <u21717@uwe> wrote in message
news:6dc3364fbea6c@uwe...
>I have a button on my ss that I want to use to create a new worksheet. The
> catch is that I want the name to be a date cell plus 14 days. Here is what I
> have so far.
>
> Sub Save_New_Tab_Click()
> Worksheets.Add After:=Worksheets(Worksheets.Count)
> Worksheets(Worksheets.Count).Name = Format((Range("A2").Value + 14), Date,
> "mm_dd_yyyy")
>
> End Sub
>
> A2 has my date in this format mm/dd/yyyy. add 14 days to get worksheet name
> in format mm_dd_yyyy. This has been driving me crazy all afternoon. What am I
> doing wrong?
>
> TIA
> Gerald
>
> --
> Message posted via http://www.officekb.com
>



 
Reply With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      14th Feb 2007
He is also trying to pick up the date from the wrong sheet.
--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Fred Smith" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> What you are doing wrong is giving Format 3 parameters, when it is looking
> for only two. Take out the " Date," from your Format function.
>
> --
> Regards,
> Fred
>
>
> "gjameson via OfficeKB.com" <u21717@uwe> wrote in message
> news:6dc3364fbea6c@uwe...
>>I have a button on my ss that I want to use to create a new worksheet. The
>> catch is that I want the name to be a date cell plus 14 days. Here is
>> what I
>> have so far.
>>
>> Sub Save_New_Tab_Click()
>> Worksheets.Add After:=Worksheets(Worksheets.Count)
>> Worksheets(Worksheets.Count).Name = Format((Range("A2").Value + 14),
>> Date,
>> "mm_dd_yyyy")
>>
>> End Sub
>>
>> A2 has my date in this format mm/dd/yyyy. add 14 days to get worksheet
>> name
>> in format mm_dd_yyyy. This has been driving me crazy all afternoon. What
>> am I
>> doing wrong?
>>
>> TIA
>> Gerald
>>
>> --
>> Message posted via http://www.officekb.com
>>

>
>



 
Reply With Quote
 
gjameson via OfficeKB.com
Guest
Posts: n/a
 
      19th Feb 2007
Gentlemen,

Thank you so much for your help. I would have responded sooner, but i was out
sick most of last week. Thanks again for the help.

Gerald

Bob Phillips wrote:
>He is also trying to pick up the date from the wrong sheet.
>> What you are doing wrong is giving Format 3 parameters, when it is looking
>> for only two. Take out the " Date," from your Format function.

>[quoted text clipped - 20 lines]
>>> TIA
>>> Gerald


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200702/1

 
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
Contact addition date Herb Segal Microsoft Outlook Contacts 4 16th Dec 2009 01:42 AM
Date addition error hc Microsoft Excel Crashes 1 4th Dec 2007 05:09 PM
Formula to give special date format but with addition? StargateFan Microsoft Excel Discussion 3 19th Nov 2007 09:50 AM
Date field addition Stephanie Microsoft Access Forms 4 13th Nov 2004 12:03 AM
Date/Time Addition Mike Mueller Microsoft Access Forms 2 1st Jul 2003 03:46 PM


Features
 

Advertising
 

Newsgroups
 


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