Need Help - To rename the sheet

Need Help - To rename the sheet

Post by Mangesh Dayn » Fri, 08 Jun 2012 23:46:42



Hi Friends,

I came across good scenario while working in excel.
I have the worksheet named "*Result*" which contain important data
and whenever I open the file I need this Result sheet should become
Result_1 automatically, so that there should not be *Result* sheet
available in workbook. If I open the file again it should be rename
Result_2 then Result_3 like this. In this way I will work on result sheet
and all previous file would become Result_1, Result_2, Result_3, Result_4,
etc.
Please help me by providing suitable code. And also tell me where I have to
put this code.

Appreciate your help for this !!!

Mangesh.

 
 
 

Need Help - To rename the sheet

Post by Rajan_Verm » Fri, 08 Jun 2012 23:58:09


Use this:

Private Sub Workbook_Open()

    Dim wksSheet As Worksheet

    For Each wksSheet In Me.Worksheets

        If wksSheet.Name Like "Result*" Then

        wksSheet.Name = "Result_" &
Val(WorksheetFunction.Substitute(wksSheet.Name, "Result_", "")) + 1

        End If

    Next wksSheet

End Sub

Regards

Rajan verma

+91 7838100659 [IM-Gtalk]


On Behalf Of Mangesh Dayne
Sent: 07 June 2012 8:17

Subject: $$Excel-Macros$$ Need Help - To rename the sheet

Hi Friends,

I came across good scenario while working in excel.

I have the worksheet named "Result" which contain important data and
whenever I open the file I need this Result sheet should become Result_1
automatically, so that there should not be Result sheet available in
workbook. If I open the file again it should be rename Result_2 then
Result_3 like this. In this way I will work on result sheet and all previous
file would become Result_1, Result_2, Result_3, Result_4, etc.

Please help me by providing suitable code. And also tell me where I have to
put this code.

Appreciate your help for this !!!

Mangesh.

--
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security
measure.

4) Acknowledge the responses you receive, good or bad.

5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited.

NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.

----------------------------------------------------------------------------
--------------------------

To unsubscribe, send a blank email to


 
 
 

Need Help - To rename the sheet

Post by Mangesh Dayn » Sat, 09 Jun 2012 00:02:57


My God !
So Quick !!
Even Shatabdi Express is not so Fast !!!

Thank you so much Rajan....!!!!


> Use this:****

> ** **

> Private Sub Workbook_Open()****

>     Dim wksSheet As Worksheet****

>     For Each wksSheet In Me.Worksheets****

>         If wksSheet.Name Like "Result*" Then****

>         wksSheet.Name = "Result_" &
> Val(WorksheetFunction.Substitute(wksSheet.Name, "Result_", "")) + 1****

>         End If****

>     Next wksSheet****

> End Sub****

> ** **

> * *

> *Regards*

> *Rajan verma*

> *+91 7838100659 [IM-Gtalk]*

> ** **



> *Sent:* 07 June 2012 8:17

> *Subject:* $$Excel-Macros$$ Need Help - To rename the sheet****

> ** **

> Hi Friends,****

> ** **

> I came across good scenario while working in excel.****

> I have the worksheet named "*Result*" which contain important data
> and whenever I open the file I need this Result sheet should become
> Result_1 automatically, so that there should not be *Result* sheet
> available in workbook. If I open the file again it should be rename
> Result_2 then Result_3 like this. In this way I will work on result sheet
> and all previous file would become Result_1, Result_2, Result_3, Result_4,
> etc. ****

> Please help me by providing suitable code. And also tell me where I have
> to put this code.****

> ** **

> Appreciate your help for this !!!****

> ** **

> Mangesh.****

> --
> FORUM RULES (986+ members already BANNED for violation)

> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will not get quick attention or may not be answered.

> 2) Don't post a question in the thread of another member.

> 3) Don't post questions regarding breaking or bypassing any security
> measure.

> 4) Acknowledge the responses you receive, good or bad.

> 5) Cross-promotion of, or links to, forums competitive to this forum in
> signatures are prohibited.

> NOTE : Don't ever post personal or confidential data in a workbook. Forum
> owners and members are not responsible for any loss.

> ------------------------------------------------------------------------------------------------------

> To unsubscribe, send a blank email to

> --
> FORUM RULES (986+ members already BANNED for violation)

> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will not get quick attention or may not be answered.

> 2) Don't post a question in the thread of another member.

> 3) Don't post questions regarding breaking or bypassing any security
> measure.

> 4) Acknowledge the responses you receive, good or bad.

> 5) Cross-promotion of, or links to, forums competitive to this forum in
> signatures are prohibited.

> NOTE : Don't ever post personal or confidential data in a workbook. Forum
> owners and members are not responsible for any loss.

> ------------------------------------------------------------------------------------------------------

> To unsubscribe, send a blank email to


 
 
 

Need Help - To rename the sheet

Post by Rajan_Verm » Sat, 09 Jun 2012 00:09:20


I think I misunderstood your question , you can use this macro :

Private Sub Workbook_Open()

    Dim wksSheet As Worksheet

    For Each wksSheet In Me.Worksheets

        If wksSheet.Name = "Result" Then

            wksSheet.Copy ,
ThisWorkbook.Worksheets(ThisWorkbook.Worksheets.Count)

            ThisWorkbook.Worksheets(ThisWorkbook.Worksheets.Count).Name =
"Result_" & ThisWorkbook.Worksheets.Count - 1

            Exit Sub

        End If

    Next wksSheet

End Sub

Regards

Rajan verma

+91 7838100659 [IM-Gtalk]


Sent: 07 June 2012 8:28

Subject: RE: $$Excel-Macros$$ Need Help - To rename the sheet

Use this:

Private Sub Workbook_Open()

    Dim wksSheet As Worksheet

    For Each wksSheet In Me.Worksheets

        If wksSheet.Name Like "Result*" Then

        wksSheet.Name = "Result_" &
Val(WorksheetFunction.Substitute(wksSheet.Name, "Result_", "")) + 1

        End If

    Next wksSheet

End Sub

Regards

Rajan verma

+91 7838100659 [IM-Gtalk]


On Behalf Of Mangesh Dayne
Sent: 07 June 2012 8:17

Subject: $$Excel-Macros$$ Need Help - To rename the sheet

Hi Friends,

I came across good scenario while working in excel.

I have the worksheet named "Result" which contain important data and
whenever I open the file I need this Result sheet should become Result_1
automatically, so that there should not be Result sheet available in
workbook. If I open the file again it should be rename Result_2 then
Result_3 like this. In this way I will work on result sheet and all previous
file would become Result_1, Result_2, Result_3, Result_4, etc.

Please help me by providing suitable code. And also tell me where I have to
put this code.

Appreciate your help for this !!!

Mangesh.

--
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please
Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will
not get quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security
measure.

4) Acknowledge the responses you receive, good or bad.

5) Cross-promotion of, or links to, forums competitive to this forum in
signatures are prohibited.

NOTE : Don't ever post personal or confidential data in a workbook. Forum
owners and members are not responsible for any loss.

----------------------------------------------------------------------------
--------------------------

To unsubscribe, send a blank email to

 
 
 

Need Help - To rename the sheet

Post by Mangesh Dayn » Sat, 09 Jun 2012 00:17:27


Hi Rajan,

Its working fine now.
Thanks again.

Mangesh


> I think I misunderstood your question , you can use this macro :****

> ** **

> Private Sub Workbook_Open()****

>     Dim wksSheet As Worksheet****

>     For Each wksSheet In Me.Worksheets****

>         If wksSheet.Name = "Result" Then****

>             wksSheet.Copy ,
> ThisWorkbook.Worksheets(ThisWorkbook.Worksheets.Count)****

>             ThisWorkbook.Worksheets(ThisWorkbook.Worksheets.Count).Name =
> "Result_" & ThisWorkbook.Worksheets.Count - 1****

>             Exit Sub****

>         End If****

>     Next wksSheet****

> End Sub****

> ** **

> ** **

> * *

> *Regards*

> *Rajan verma*

> *+91 7838100659 [IM-Gtalk]*

> ** **


> *Sent:* 07 June 2012 8:28

> *Subject:* RE: $$Excel-Macros$$ Need Help - To rename the sheet****

> ** **

> Use this:****

> ** **

> Private Sub Workbook_Open()****

>     Dim wksSheet As Worksheet****

>     For Each wksSheet In Me.Worksheets****

>         If wksSheet.Name Like "Result*" Then****

>         wksSheet.Name = "Result_" &
> Val(WorksheetFunction.Substitute(wksSheet.Name, "Result_", "")) + 1****

>         End If****

>     Next wksSheet****

> End Sub****

> ** **

> * *

> *Regards*

> *Rajan verma*

> *+91 7838100659 [IM-Gtalk]*

> ** **



> *Sent:* 07 June 2012 8:17

> *Subject:* $$Excel-Macros$$ Need Help - To rename the sheet****

> ** **

> Hi Friends,****

> ** **

> I came across good scenario while working in excel.****

> I have the worksheet named "*Result*" which contain important data
> and whenever I open the file I need this Result sheet should become
> Result_1 automatically, so that there should not be *Result* sheet
> available in workbook. If I open the file again it should be rename
> Result_2 then Result_3 like this. In this way I will work on result sheet
> and all previous file would become Result_1, Result_2, Result_3, Result_4,
> etc. ****

> Please help me by providing suitable code. And also tell me where I have
> to put this code.****

> ** **

> Appreciate your help for this !!!****

> ** **

> Mangesh.****

> --
> FORUM RULES (986+ members already BANNED for violation)

> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will not get quick attention or may not be answered.

> 2) Don't post a question in the thread of another member.

> 3) Don't post questions regarding breaking or bypassing any security
> measure.

> 4) Acknowledge the responses you receive, good or bad.

> 5) Cross-promotion of, or links to, forums competitive to this forum in
> signatures are prohibited.

> NOTE : Don't ever post personal or confidential data in a workbook. Forum
> owners and members are not responsible for any loss.

> ------------------------------------------------------------------------------------------------------

> To unsubscribe, send a blank email to

> --
> FORUM RULES (986+ members already BANNED for violation)

> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will not get quick attention or may not be answered.

> 2) Don't post a question in the thread of another member.

> 3) Don't post questions regarding breaking or bypassing any security
> measure.

> 4) Acknowledge the responses you receive, good or bad.

> 5) Cross-promotion of, or links to, forums competitive to this forum in
> signatures are prohibited.

> NOTE : Don't ever post personal or confidential data in a workbook. Forum
> owners and members are not responsible for any loss.

> ------------------------------------------------------------------------------------------------------

> To unsubscribe, send a blank email to