Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A:A"
Dim sh As Worksheet
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If .Value <> "" Then
On Error Resume Next
Set sh = Worksheets(.Value)
On Error GoTo 0
If sh Is Nothing Then
Worksheets.Add(after:=Worksheets(Worksheets.Count)).Name
= .Value
Me.Activate
End If
End If
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub
'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

Signature
HTH
Bob Phillips
(replace somewhere in email address with gmail if mailing direct)
> I am currently trying to create somthing, I dont even know if excel is
> capable of doing it however.
[quoted text clipped - 11 lines]
> *Sorry for the dbl post....have NO idea which forum this would apply
> to**
thanks,
the '=.Value' area is giving me a compile error however?

Signature
londar
Bob Phillips - 12 Jul 2006 18:24 GMT
wrap-around
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A:A"
Dim sh As Worksheet
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If .Value <> "" Then
On Error Resume Next
Set sh = Worksheets(.Value)
On Error GoTo 0
If sh Is Nothing Then
Worksheets.Add(after:=Worksheets(Worksheets.Count)) _
.Name = .Value
Me.Activate
End If
End If
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub

Signature
HTH
Bob Phillips
(replace somewhere in email address with gmail if mailing direct)
> thanks,
>
> the '=.Value' area is giving me a compile error however?
londar - 12 Jul 2006 18:51 GMT
it is still giving me an error right here:
Worksheets.Add(after:=Worksheets(Worksheets.Count)) _
.Name = .Value
I am correct in just copying and pasting what you typed out into the
code section correct.
I really appreciate the help

Signature
londar
Bob Phillips - 12 Jul 2006 20:14 GMT
It works fine for me. Presumably, you are typing the value into column A?

Signature
HTH
Bob Phillips
(replace somewhere in email address with gmail if mailing direct)
> it is still giving me an error right here:
>
[quoted text clipped - 5 lines]
>
> I really appreciate the help
londar - 12 Jul 2006 21:26 GMT
correct it is going into column A.
I copy and pasted exactly what you typed.

Signature
londar
Pete_UK - 12 Jul 2006 23:25 GMT
Try splitting the line at a different point, i.e.:
Worksheets.Add(after:=Worksheets(Worksheets.Count)).Name _
= .Value
Hope this helps.
Pete
> correct it is going into column A.
>
[quoted text clipped - 5 lines]
> londar's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=32970
> View this thread: http://www.excelforum.com/showthread.php?threadid=560743
Bob Phillips - 12 Jul 2006 23:49 GMT
Did you copy and paste or type it? I believe Excel forum sometimes loses the
dots, so check the code here http://tinyurl.com/kckne

Signature
HTH
Bob Phillips
(replace somewhere in email address with gmail if mailing direct)
> correct it is going into column A.
>
> I copy and pasted exactly what you typed.
londar - 17 Jul 2006 21:43 GMT
ya i have copied that and still nothing.
Just to make sure I am doing this right. I have the sheet where thes
locations I am adding located on SHeet1.
I am right clicking the Sheet1 tab and clicking view code. I am the
pasting that text as it appears into this area.
is this right or am I missing a big step causing these issues?
Thanks
Bob Phillips Wrote:
> Did you copy and paste or type it? I believe Excel forum sometimes lose
> the
[quoted text clipped - 19 lines]
> > View this thread
> http://www.excelforum.com/showthread.php?threadid=560743
Bob Phillips - 18 Jul 2006 11:39 GMT
yeah, that is what you should do

Signature
HTH
Bob Phillips
(replace somewhere in email address with gmail if mailing direct)
> ya i have copied that and still nothing.
> Just to make sure I am doing this right. I have the sheet where these
[quoted text clipped - 31 lines]
> > > View this thread:
> > http://www.excelforum.com/showthread.php?threadid=560743
http://www.excelforum.com/member.php?action=getinfo&userid=32970
> View this thread: http://www.excelforum.com/showthread.php?threadid=560743