Hi
I'm trying to add a sheet for so to name it "formulas".
How can I do that?
Hi
I'm trying to add a sheet for so to name it "formulas".
How can I do that?
The following code checks all the worksheets in the workbook to see if there
is sheet named "Formulas" already present in the file. If it does exist,
nothing happens, if it doesn't exist a new worksheet is added and named.
Sub AddSheet()
Dim ws As Worksheet
Dim wb As Workbook
Dim strName As String
Dim blnFound As Boolean
Set wb = ActiveWorkbook
For Each ws In wb.Worksheets
strName = ws.Name
If strName = "Formulas" Then
blnFound = True
Exit For
Else
blnFound = False
End If
Next ws
If Not blnFound Then
ActiveWorkbook.Worksheets.Add
ActiveSheet.Name = "Formulas"
End If
End Sub
--
Kevin Backmann
"Ctech" wrote:
>
> Hi
>
> I'm trying to add a sheet for so to name it "formulas".
>
> How can I do that?
>
>
> --
> Ctech
> ------------------------------------------------------------------------
> Ctech's Profile: http://www.excelforum.com/member.php...o&userid=27745
> View this thread: http://www.excelforum.com/showthread...hreadid=500157
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks