Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2
Default how can you rename a workgroup from a cell

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

For instant in Workbook 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 workbook would be created and
named the date entered into B12
and so on

Is this out of the question

  #2   Report Post  
Posted to microsoft.public.excel.newusers
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default how can you rename a workgroup from a cell

Try this. Right click on your worksheet and paste this code into the code
module. Change the range "B11:B12" to whatever range you have in mind. Or,
if you want to use the entire column B, change
If Not Intersect(Target, Range("B11:B12")) Is Nothing Then
to
If Target.Column = 2 Then

Since worksheet names cannot contain special characters, such as "/", I
replaced the "/" with periods "."


Private Sub Worksheet_Change(ByVal Target As Range)
Dim wksTemp As Worksheet

If Not Intersect(Target, Range("B11:B12")) Is Nothing Then
On Error Resume Next
Set wksTemp = Sheets(Replace(Target.Value, _
"/", ".", 1, -1, vbTextCompare))
On Error GoTo 0
If wksTemp Is Nothing And IsDate(Target.Value) Then
Set wksTemp = Sheets.Add(after:=Sheets(Sheets.Count))
wksTemp.Name = Replace(Target.Value, _
"/", ".", 1, -1, vbTextCompare)
Target.Parent.Activate
End If
End If

End Sub


"Zane" wrote:

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

For instant in Workbook 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 workbook would be created and
named the date entered into B12
and so on

Is this out of the question


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
insert date Larry Excel Worksheet Functions 28 July 15th 06 02:41 AM
Compiling macro based on cell values simonsmith Excel Discussion (Misc queries) 1 May 16th 06 08:31 PM
Urgent date/scheduling calc needed jct Excel Worksheet Functions 3 February 24th 06 01:36 AM
copying cell names Al Excel Discussion (Misc queries) 12 August 11th 05 03:01 PM
up to 7 functions? ALex Excel Worksheet Functions 10 April 12th 05 06:42 PM


All times are GMT +1. The time now is 04:07 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"