Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Renaming worksheet on the basis of workbook name

Dear Experts:

I got an excel file named Chapter1.xls

The fourth worksheet of this file should be renamed via VBA as
follows:

NoMatch_1

I would like to use this code (snippet) for the renaming of other
worksheets as well, such as

File name: Chapter2.xls: renaming of worksheet 4 to 'NoMatch_2'
File name: Chapter3.xls: renaming of worksheet 4 to 'NoMatch_3'

That is the number at the end of the relevant excel file name is to be
placed at the end of the fourth worksheet name. (NoMatch_relevant
number)

Help is much appreciated. Thank you very much in advance.

Regards, Andreas
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Renaming worksheet on the basis of workbook name

On Jun 19, 3:23*pm, andreashermle wrote:
Dear Experts:

I got an excel file named Chapter1.xls

The fourth worksheet of this file should be renamed via VBA as
follows:

NoMatch_1

I would like to use this code (snippet) for the renaming of other
worksheets as well, such as

File name: Chapter2.xls: renaming of worksheet 4 to 'NoMatch_2'
File name: Chapter3.xls: renaming of worksheet 4 to 'NoMatch_3'

That is the number at the end of the relevant excel file name is to be
placed at the end of the fourth worksheet name. (NoMatch_relevant
number)

Help is much appreciated. Thank you very much in advance.

Regards, Andreas


How about:

Sub ReNameSheet()
numberr = "_" & Right(Split(ActiveWorkbook.Name, ".")(0), 1)
Sheets(4).Name = Sheets(4).Name & numberr
End Sub
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default Renaming worksheet on the basis of workbook name

On Jun 20, 12:02*am, James Ravenswood
wrote:
On Jun 19, 3:23*pm, andreashermle wrote:





Dear Experts:


I got an excel file named Chapter1.xls


The fourth worksheet of this file should be renamed via VBA as
follows:


NoMatch_1


I would like to use this code (snippet) for the renaming of other
worksheets as well, such as


File name: Chapter2.xls: renaming of worksheet 4 to 'NoMatch_2'
File name: Chapter3.xls: renaming of worksheet 4 to 'NoMatch_3'


That is the number at the end of the relevant excel file name is to be
placed at the end of the fourth worksheet name. (NoMatch_relevant
number)


Help is much appreciated. Thank you very much in advance.


Regards, Andreas


How about:

Sub ReNameSheet()
numberr = "_" & Right(Split(ActiveWorkbook.Name, ".")(0), 1)
Sheets(4).Name = Sheets(4).Name & numberr
End Sub- Hide quoted text -

- Show quoted text -


Hi James,

another praise. Works just fine, Thank you very much for your great
support.

Regards, Andreas
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
renaming a workbook serge T Excel Programming 6 October 22nd 07 09:57 AM
Workbook renaming billyb Excel Programming 3 May 31st 04 04:05 PM
Workbook renaming! aiyer[_21_] Excel Programming 1 May 12th 04 08:03 PM
Renaming workbook! aiyer[_20_] Excel Programming 1 May 11th 04 11:34 PM
Workbook crashes after renaming a worksheet - References problem? BenD[_2_] Excel Programming 0 April 21st 04 01:22 AM


All times are GMT +1. The time now is 03:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"