create a new worksheet when a cell has a date entered

I am trying to create a new worksheet when a cell has a date entered
into it

For instant in Worksheet 1 you type into cell B11 a date
I would like to automaticly create a new worksheet and call it that
date entered to B11
Then if I type a Date into cell B12 a new worksheet would be created
and
named the date entered into B12
and so on 


Is this out of the question

0
zlint (2)
10/11/2006 7:25:17 PM
excel.newusers 15348 articles. 2 followers. Follow

2 Replies
738 Views

Similar Articles

[PageSpeed] 51

See response in your other post.


"Zane" wrote:

> I am trying to create a new worksheet when a cell has a date entered
> into it
> 
> For instant in Worksheet 1 you type into cell B11 a date
> I would like to automaticly create a new worksheet and call it that
> date entered to B11
> Then if I type a Date into cell B12 a new worksheet would be created
> and
> named the date entered into B12
> and so on 
> 
> 
> Is this out of the question
> 
> 
0
jmb (270)
10/12/2006 4:41:02 AM
Sure, can do with some considerations - can't have 2 sheets with same name 
(date), and sheet names have some limitations, but this should give you a 
start.  It looks specifically in B11 and B12 for a date and if a date was 
entered in either of those, tries to add the sheet to the end of the workbook.

To place this code into where it needs to go, right-click on the sheet tab 
that you will be entering the dates onto and choose [View Code] from the list 
that appears.  Copy this code and paste it into the code module that appears. 
 Close the VB Editor and give it a spin:

Private Sub Worksheet_Change(ByVal Target As Range)
    Dim iSect As Range
    Dim mySheet As String
    
    Set iSect = Application.Intersect(Target, Range("B11:B12"))
    If iSect Is Nothing Then
        Exit Sub
    End If
    If Not (IsDate(Target)) Then
        Exit Sub
    End If
    mySheet = ActiveSheet.Name
    Application.ScreenUpdating = False
    'test to see if a sheet with anticipated name
    'already exists
    On Error Resume Next
    Worksheets(Format(Target.Value, "dd-mmm-yyyy")).Select
    If Err = 0 Then
        MsgBox "You already have a sheet for this date. No sheet added."
        GoTo ExitSheetAdd
    End If
    Err.Clear
    On Error GoTo SheetAddError
    Application.EnableEvents = False
    Worksheets.Add after:=Worksheets(Worksheets.Count)
    Worksheets(Worksheets.Count).Name = _
       Format(Target.Value, "dd-mmm-yyyy")
ExitSheetAdd:
    On Error GoTo 0
    Worksheets(mySheet).Select
    Application.EnableEvents = True
    Application.ScreenUpdating = True
    Exit Sub
SheetAddError:
    MsgBox "Error: " & Err.Number & vbCrLf & Err.Description
    GoTo ExitSheetAdd
End Sub


"Zane" wrote:

> I am trying to create a new worksheet when a cell has a date entered
> into it
> 
> For instant in Worksheet 1 you type into cell B11 a date
> I would like to automaticly create a new worksheet and call it that
> date entered to B11
> Then if I type a Date into cell B12 a new worksheet would be created
> and
> named the date entered into B12
> and so on 
> 
> 
> Is this out of the question
> 
> 
0
Utf
10/12/2006 5:01:03 AM
Reply:

Similar Artilces:

create a roster
How can you create a weekly roster in which functions can be assigned to more than 10 people. The roster should be updatable, so that when holidays and days off are marked on the weekly roster they will be taken account of it future rosters. ...

importing or creating reference footnotes
I am trying to import a word document into publisher and it has reference footnotes within the document. The reference footnotes are not coming into the publisher document with the reference footnotes. Correct, they will not up to Publisher 2003. In Publisher 2003 depending on which version of Word you are using if they will or not. -- "If you don't know where you are going, any road will take you there!" ...

Mailbox not created when AD account created
A couple of days ago I noticed that I created a user account but the 'Email Addresses' tab of the user properies did not list any email addresses. Subsequent new user accounts have all experienced the same. I researched the knowledge and tried the recommended solutions to either manaully start the recipient update service or rebuild te recipient update service. Neither recommendation has resulted in a mailbox being created for this particular user or any additional user that I have created since this error first showed up. I performed a Windows update last Thursday and so I bel...

How Enter Special Character With Dots Over It?
Hello. I need to enter special characters with dots over them. I know this can be done with vowels and the letter 'y' by keying Shift-Control and then the letter. But I need to do it over *consonants* - at least capital B and V and maybe so others. If beggars can be choosers, I would very much prefer three dots instead of just two. Any ideas? Thanks! On Wed, 27 Jan 2010 18:15:01 -0800, Peyton Todd <Peyton Todd@discussions.microsoft.com> wrote: >Hello. I need to enter special characters with dots over them. I know this >can be done with vowels and the l...

Task Create - Status
I'm trying to make a simple task, when a user owner is assigned a task in CRM, it receives an email letting it know it has one. I have the following below, but it is not generating one when i assign one manually in the CRM. What to do? I've tried both the following: When task is created E-Mail to:[owner];Subject test As well as: When task is created if Task activity status = Open then E-Mail to:[owner];Subject test I've checked the mailserver many times over, and I can send emails manually from the CRM so you can rule that out Tested out ok on our end. Some ideas:...

EPay Date and Status
Hi, In Money 2001 when a transaction was paid with epay it used the date of the transaction, but in 2002 and 2003 if I have a transaction for the 20th and set it to EPay on the 5th (not changing the dates but actually on the 5th set the epay for the 20th) Money will move the transaction to 15th or so. Is there a way to turn this off? ...

New Store in other country
hi all, we have opened a new store in other foreign country, the problem is this new store will receive stock and sell with his local currancy ( currancy rate 1.2 ). How can we manage this store ( calculate the cost ,reports... etc) in HQ. any help please thanks Get ready for a lot of manual work. The way I handle it is each stoer is in local currency. When I transfer something from location to location, I manually change the costs on the transfer in at the receiving store. "Sad" <Sad@discussions.microsoft.com> wrote in message news:B929754D-D285-42BA-B2D1-03D6D0262902...

In copied worksheet, embedded chart uses data fm orig
When I copy a worksheet, I want the embedded chart to automatically use data from the new worksheet, Instead, it uses data from the original worksheet. So I have to edit each data series in the chart everytime I create a new worksheet by copying an old one. Example: worksheet displaying hours worked that week. When I copy the sheet to start a new week, the embedded chart is displaying data from last week. It seems you are making the new worksheet with Copy & Paste. Try this instead: click on the tab of original sheet (let's call it Sheet1), hold the CTRL key down and drag the tab ...

Bug with cell merging in tables using Applescript
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Once you have merged cells in a table in Word 2008 using Applescript, any further reference to the table's cells in the script produce an error. <br><br>As an example, open Word 2008 and run this script: <br> tell application &quot;Microsoft Word&quot; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;make new table at active document with properties {number of rows:4, number of columns:4} <br> &nbsp;&nbsp;&nbsp;&nbsp...

Help Creating XmlNode / XmlAttribute Elegantly
I am creating a configuration class to read / write a standard configuration file. <?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="ConnectionString" value="server=(local);" /> </appSettings> </configuration> I am using a XmlDocument for my base implementation. I am looking to see if there is a better way to add a new node / attribute than using XmlDocument.InnerXml. I would consider this to be a hack but couldn't really see another way of doing this without definin...

Create external database
Hi all. I need to create an external database (file). On a site I found this code: ------------------------------------------------------ Function CreateLinkedExternalTable(strTargetDB As String, strProviderString As String, strSourceTbl As String, strLinkTblName As String) As String 'strTargetDB = Source Database Name 'strProviderString = Not used, currently hard coded 'strSourceTbl = Source Table name in the database we are linking too. 'strLinkTblName = Table name we would like to see in the Access Database. Dim catDB As ADOX.Catalog Dim tblLink As...

How to create pie chart with %
I have got a problem that I don't if excel could help me to calculate the % within a column and draw a pie chart. My case is I have a column containing a series of numbers. e.g. 1,4,8,1,3,9,11,2,4,5,6,.........etc I want to draw a pie chart that showing 1-3 , 4-6, 7-9, >9 with the corresponding % inside that column. Can anyone tell me how can I make it ? Ray - You need to calculate the frequencies in your data. Let's assume your data is in A1:A12. In B1:B3 enter these numbers, the upper limits on the groupings: 3 6 9 You can enter ">9" into B4 witho...

Stagnant cell for counting filtered data
I want to keep one cell that houses the count of the data depending on how it is filtered and that cell remain visible despite how it is filtered. I can't get the formula =COUNT(C9,C1:C100) to work or get it to stay visible if I change the filter. Place the formula in row 1 that contains your titles...........assuming you have these. =SUBTOTAL(2,C2:C100) the 2, means count If you don't have titles in row 1, place the formula after a blank row below your data. Note: you use COUNT in your original. COUNT only counts numerics. Maybe you want COUNTA which would be =SUBTOT...

Email address not created when a new user is created
All, This issue recently happened in my company. Upon creating a new user, the policy was set to create the smtp and X400 address automaticaly. Now when we create a user the smtp and x400 addresses are not created, and when attempting to setup the new user in outlook, the address cant be found. We are using exchange 2003 SP1 on Win2k3 servers. On Wed, 13 Jul 2005 06:49:07 -0700, "Bryan" <Bryan@discussions.microsoft.com> wrote: >All, >This issue recently happened in my company. Upon creating a new user, the >policy was set to create the smtp and X400 addres...

Month End Date Ticks
Hello, In Excel 2003 I could use daily data starting on, say, 31 Dec 2005 and ending some years later for a line chart. If in the x-axis settings I selected both Major and Minor units to 3 Months with Base units as Days I would get ticks at each calender quarter end. In this example; 31 Dec 2005, 31 Mar 2006, 30 Jun 2006, and so on. However, in Excel 2007 the axis switches over to start of month ticks; 31 Dec 2005, 31 Mar 2006, 1 Jul 2006, and so on. Does anyone know what is going on with the date x-axis in Excel 2007? It seems to be a bug as I have tried all manner of settings an...

how do I copy a range to a new sheet
Now that I this group solved my problem of flagging dates of my club members as "expired", how would I automatically copy all of the members that are expired to a new worksheet so I can use this for a mail merge? I would need to check the condition of the expired column, YES or NO, then copy the yes's name and address columns only to a new page. TIA Why not just add that column and when you use mailmerge, just include the records with that flag set the way you need? If you really want to copy the rows, you could apply Data|Filter|Autofilter and filter to show just those mem...

when form created
I have a form which was created by someone else (not a form template) which is like a questionnaire with empty boxes to be completed. When the boxes are typed in all the margins move to accommodate the words being typed. Is there a way to fix/lock the original form and then just fill in the blank boxes? I suspect this is set up as a table with auto resizing enabled. Displaying table gridlines (Table | Show Gridlines) will help you see what you're dealing with. Then select the table, go to the Table tab of Table Properties, click Options, and clear the check box for "A...

Exchange 2010 MRM, no log files being created
I'm hoping someone can help me with this issue....it has been driving me crazy for days. I have enabled MRM logging on our exchange server, and I can see that some of the policies are working when I run start-managedfolderassistant. We have a retention policy tag on the deleteditems folder, and this does work. The problem is I am not getting any files in the MRM log directory. C:\Program Files\Microsoft\Exchange Server\V14\Logging\Managed Folder Assistant Events 9021 and 9022 are logged in the Application log, but where are the files? Below is the output of my mai...

Outlook notification of new mail.
To clarify, the notification works for new messages to Inbox, but fails to display the icon when the message is automatically moved to a subfolder based on a rule. A quick look in Google seems to to suggest that this is something that has been deliberately changed from Outlook XP. Cheers Paul <paul.francis@agresearch.co.nz> wrote: > To clarify, the notification works for new messages to > Inbox, but fails to display the icon when the message is > automatically moved to a subfolder based on a rule. A > quick look in Google seems to to suggest that this is > somethin...

How do you edit HTML source in a new outlook email message?
Trying to create a new email message by inserting HTML. I don't see a place to edit source for a new message. This is probably a really easy thing to do, I just can't find out where the "edit source" option is, and the help files don't seem to be any help. Thanks, Justin The feature doesn't exist in Microsoft Outlook. "justinvanderpol" <justinvanderpol@discussions.microsoft.com> wrote in message news:1ADC71DF-40BC-4656-98A8-A473EB40E837@microsoft.com... > Trying to create a new email message by inserting HTML. I don't see a > place ...

Creating a Brochure
How do you create a 3-column brochure from scratch for Publisher 2002? I can only find the directions for the 2003 version. Quick help would be appreciated, project is due Monday. Create a three-panel or four-panel folded publication http://office.microsoft.com/en-us/assistance/HP011646681033.aspx Scroll down to the section that says "Build a three-panel or four-panel publications from scratch." -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Derek" <Derek@discussions.microsoft.com> wrote in message news...

New POP3 E-Mail Account Deliver Folder
I have both an Exchange Account and a (personal) POP3 account that I check using Outlook 2003. Currently, both accounts drop new e-mail into my Exchange Inbox - and I have a rule that moves the POP3 e-mail to a personal folder inbox. Problem is, rules don't run when I'm not connected to the Exchange server. Is it possible to have the POP3 account post new e-mails to the personal folder, while keeping the Exchange account posting new e-mails to the exchange inbox? Thanks; Michael Have you tried to set up a personal folder specifically for the pop account and set the exchange acc...

Users mailboxes not created when user created
I have a problem that recently just started happening on my exchange 2003 server. When i create a new user account and create the mailbox for exchange, once im done, the mailbox isnt created, adn if you go into the properties of the user account adn go to the exchange email address tab, there isnt an smtp or an x.400 address listed. I am having to manually create and add these, adn then go delete the exchange mailbox and recreate it. This is really annoying and would love to know if anyone has any ideas of how to fix it. Thanks Jason In news:9F836A43-98BF-435A-AA43-AFF10124BE3F@micro...

How do you print an Excel worksheet to show the rows and columns?
I'm new to Excel, and trying to print a document that will show the rows and columns, rather than just the information. How do I do this? In Excel 97 (later versions will, I assume, be similar) click File - Page Setup. Then select the "Sheet" tab and in the box labelled "Print" will be a checkbox labelled "Gridlines". Check that and print it. Peter "Michaelangelo" <Michaelangelo@discussions.microsoft.com> wrote in message news:A635EBC2-AB49-45D8-803D-5C2E91ACDDAC@microsoft.com... > I'm new to Excel, and trying to print a document th...

Hot to shift Outlook 2003 to new machine
I've built a new box and want to start replicating my setop from my old machine. As I use Outlook 2003 heavily, how do I transfer everything messages, tasks, rules etc from the old to the new machine??? Your advice would be appreciated Scooter The Help Files have you covered. Only one error in them: do NOT copy you previous PST file to the default directory. Copy them anywhere else you want, but not there because you'll overwrite the PST file Outlook creates for itself: http://office.microsoft.com/en-us/assistance/HA010771141033.aspx More information here: http://www.slips...