try this

Option Compare Text
Sub test()
Dim i As Long
Dim swa As Boolean


Dim ws As Worksheet

Sheets(1).Select
For i = 2 To Sheets(1).Range("a2").End(xlDown).Row
swa = False
For Each ws In ThisWorkbook.Sheets
If Sheets(1).Range("a" & i).Value = ws.Name Then
swa = True
Exit For
End If

Next ws

If swa = False Then
Sheets.Add After:=Sheets(Sheets.Count)
ActiveSheet.Name = Sheets(1).Range("a" & i).Value
Exit For
End If

Next i

End Sub




On Mon, Jul 11, 2011 at 4:21 PM, SAJID MEMON <sajidwi...@hotmail.com> wrote:

>  Dear experts
>
> I have attached my file, for renaming sheet with adding one sheet (1001)
> only at once click
> when we press once command button only one sheet should be created as name
> 1001
> again when i press second time press that button second sheet should be
> created as name 1002 and so on.
>
> Hope for positive responce and earlier
>
> thanks for previous query reply to Rajan, Mahesh & Daniel.
>
> Yours
>
> Sajid Memon
>  094376 38986.
>
> --
>
> ----------------------------------------------------------------------------------
> Some important links for excel users:
> 1. Follow us on TWITTER for tips tricks and links :
> http://twitter.com/exceldailytip
> 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
> 3. Excel tutorials at http://www.excel-macros.blogspot.com
> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
>
> To post to this group, send email to excel-macros@googlegroups.com
>
> <><><><><><><><><><><><><><><><><><><><><><>
> Like our page on facebook , Just follow below link
> http://www.facebook.com/discussexcel
>



-- 
*Regards*
* *
*Ashish Koul*
*akoul*.*blogspot*.com <http://akoul.blogspot.com/>
http://akoul.posterous.com/
*akoul*.wordpress.com <http://akoul.wordpress.com/>
My Linkedin Profile <http://in.linkedin.com/pub/ashish-koul/10/400/830>


P Before printing, think about the environment.

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to