I'm sorry, I should have told you that it executes when B6 is changed.
It's likely that B6 won't change. If the new tab could be created when a
button is clicked (crated from the control toolbar) that would be perfect!!
Thanks
> I'm sorry, I should have told you that it executes when B6 is changed.
>
[quoted text clipped - 38 lines]
> > > >
> > > > Thanks for the help!
Barb Reinhardt - 20 Apr 2007 21:54 GMT
Use this for the control bar code.
Sub Test()
Dim aWS As Worksheet
Dim myWS As Worksheet
Set aWS = ActiveSheet
If Not IsEmpty(aWS.Range("B6")) Then
Set myWS = Nothing
On Error Resume Next
Set myWS = Worksheets(Range("B6").Value)
On Error GoTo 0
If myWS Is Nothing Then
Set myWS = Worksheets.Add
myWS.Name = aWS.Range("B6").Value
End If
lrow = aWS.Cells(Rows.Count, 1).End(xlUp).Row
Debug.Print lrow
For i = 1 To lrow
myWS.Cells(2, 2 + i).Value = aWS.Cells(i, 1).Value
Next i
End If
> It's likely that B6 won't change. If the new tab could be created when a
> button is clicked (crated from the control toolbar) that would be perfect!!
[quoted text clipped - 43 lines]
> > > > >
> > > > > Thanks for the help!