Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default Create and name new sheet...


I have my criteria and fields set on a worksheet. Once someone pulls
up the sheet (tab) I would like for them to enter a date in cell A1.
Based on the date entered (once it is entered), I would like to (A)
automatically update the name of the current sheet to the month & year
given in A1; (B) create another sheet (copying the entire existing
sheet - except A1) named for the next month.

Example:
if someone enters a date 6/09/2007 in A1.

Macro would:
Rename current sheet June 07
Create a copy of the current sheet.
Name the copy July 07.

Any suggestions?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Create and name new sheet...

Right click sheet tabview codeinsert this.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
mc = Target
ActiveSheet.Name = "x"
Sheets(ActiveSheet.Index + 1).Name = "xx"
ActiveSheet.Name = Format(mc, "mmm yy")
x = DateSerial(Year(mc), Month(mc) + 1, 1)
Sheets(ActiveSheet.Index + 1).Name = Format(x, "mmm yy")
End If
End Sub

--
Don Guillett
SalesAid Software

"J.W. Aldridge" wrote in message
oups.com...

I have my criteria and fields set on a worksheet. Once someone pulls
up the sheet (tab) I would like for them to enter a date in cell A1.
Based on the date entered (once it is entered), I would like to (A)
automatically update the name of the current sheet to the month & year
given in A1; (B) create another sheet (copying the entire existing
sheet - except A1) named for the next month.

Example:
if someone enters a date 6/09/2007 in A1.

Macro would:
Rename current sheet June 07
Create a copy of the current sheet.
Name the copy July 07.

Any suggestions?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Create and name new sheet...

A RE-read suggests that you may want this in the ThisWorkbook module instead
to do from any sheet.

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
On Error GoTo nogood
If Target.Address = "$A$1" Then
mc = Target
ActiveSheet.Name = "xxxx"
ActiveSheet.Name = Format(mc, "mmm yy")
x = DateSerial(Year(mc), Month(mc) + 1, 1)
Sheets.Add after:=ActiveSheet
ActiveSheet.Name = Format(x, "mmm yy")
End If
Exit Sub
nogood:
MsgBox "have one already"
End Sub


--
Don Guillett
SalesAid Software

"J.W. Aldridge" wrote in message
oups.com...

I have my criteria and fields set on a worksheet. Once someone pulls
up the sheet (tab) I would like for them to enter a date in cell A1.
Based on the date entered (once it is entered), I would like to (A)
automatically update the name of the current sheet to the month & year
given in A1; (B) create another sheet (copying the entire existing
sheet - except A1) named for the next month.

Example:
if someone enters a date 6/09/2007 in A1.

Macro would:
Rename current sheet June 07
Create a copy of the current sheet.
Name the copy July 07.

Any suggestions?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 425
Default Create and name new sheet...

Thanx for the above...

Only one problem...

Would like to copy the current/original sheet.

The sheet generated should be a copy of the original sheet - with A1
blank (but just named for the next month).

Is this possible?

As always, THANX!


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
How to create Login & Log out Spread sheet in Excel with automated Attendance sheet marc5354 Excel Worksheet Functions 2 September 21st 10 04:22 PM
Create new sheets based off Data sheet, and template sheet Midget Excel Programming 2 May 1st 07 09:55 PM
create a formula in one sheet that would read data from separate sheet automatically QD Excel Discussion (Misc queries) 0 December 8th 06 04:17 AM
Pick projects from sheet and create new sheet per project GregR Excel Programming 4 February 6th 06 05:51 PM
How to create a Macro to Copy Information in one sheet to another sheet. poppy Excel Programming 3 July 28th 04 07:26 AM


All times are GMT +1. The time now is 04:57 PM.

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

About Us

"It's about Microsoft Excel"