Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Matching sheet name to value in cell

I am working on a system where the user can select a job and go to the sheet
where the details of that job are held. I have disabled the option to view
the sheets due to GUI design. I cannot change the sheet name to equal the job
name entered as text on a sheet . Below is the current code

Sheets("NewJob").Select
Sheets("NewJob").Copy Befo=Sheets(1) ' copying sheet "NewJob" The
copied sheet becomes NewJob (2)
ActiveWorkbook.Unprotect
ActiveSheet.Shapes("CmdSaveJob").Select
Selection.Delete 'deleting an object
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.Range("C8:E8").Select ' where the name of the job is
Selection.Copy
Application.Run "Prototype2.xls!Addjob"

Sheets("Job").Select
Range("C29").Select
ActiveSheet.Paste ' copying name of the job to another sheet to populate
a combo box using data validation and a list
Application.CutCopyMode = False
Selection.Insert Shift:=xlDown
Range("B10").Select

Sheets("NewJob").Select
ActiveSheet.Range("C8:E8") = ""
ActiveSheet.Range("C10:d10") = ""
ActiveSheet.Range("C12") = ""
ActiveSheet.Shapes("Comments").Select
Selection.Characters.Text = ""
ActiveWorkbook.Save

Each time a sheet is copied the new sheet is named "New Job (2)" or (3) etc.
I either want a method of matching the job name on the sheet to the sheetname
or a method of changing the sheetname to the job name.

Any suggestions??? Would greatly appreciate it.

Nathan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Matching sheet name to value in cell

Activesheet.Name = ActiveSheet.Range("C29").Value

Change Range("C29") to reflect where the name is to be found.

--
Regards,
Tom Ogilvy

"NathanG" wrote in message
...
I am working on a system where the user can select a job and go to the

sheet
where the details of that job are held. I have disabled the option to view
the sheets due to GUI design. I cannot change the sheet name to equal the

job
name entered as text on a sheet . Below is the current code

Sheets("NewJob").Select
Sheets("NewJob").Copy Befo=Sheets(1) ' copying sheet "NewJob" The
copied sheet becomes NewJob (2)
ActiveWorkbook.Unprotect
ActiveSheet.Shapes("CmdSaveJob").Select
Selection.Delete 'deleting an object
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,

Scenarios:=True
ActiveSheet.Range("C8:E8").Select ' where the name of the job is
Selection.Copy
Application.Run "Prototype2.xls!Addjob"

Sheets("Job").Select
Range("C29").Select
ActiveSheet.Paste ' copying name of the job to another sheet to

populate
a combo box using data validation and a list
Application.CutCopyMode = False
Selection.Insert Shift:=xlDown
Range("B10").Select

Sheets("NewJob").Select
ActiveSheet.Range("C8:E8") = ""
ActiveSheet.Range("C10:d10") = ""
ActiveSheet.Range("C12") = ""
ActiveSheet.Shapes("Comments").Select
Selection.Characters.Text = ""
ActiveWorkbook.Save

Each time a sheet is copied the new sheet is named "New Job (2)" or (3)

etc.
I either want a method of matching the job name on the sheet to the

sheetname
or a method of changing the sheetname to the job name.

Any suggestions??? Would greatly appreciate it.

Nathan



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Matching sheet name to value in cell


Thank you. That worked.

Kind regards,

Nathan
"Tom Ogilvy" wrote:

Activesheet.Name = ActiveSheet.Range("C29").Value

Change Range("C29") to reflect where the name is to be found.

--
Regards,
Tom Ogilvy

"NathanG" wrote in message
...
I am working on a system where the user can select a job and go to the

sheet
where the details of that job are held. I have disabled the option to view
the sheets due to GUI design. I cannot change the sheet name to equal the

job
name entered as text on a sheet . Below is the current code

Sheets("NewJob").Select
Sheets("NewJob").Copy Befo=Sheets(1) ' copying sheet "NewJob" The
copied sheet becomes NewJob (2)
ActiveWorkbook.Unprotect
ActiveSheet.Shapes("CmdSaveJob").Select
Selection.Delete 'deleting an object
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,

Scenarios:=True
ActiveSheet.Range("C8:E8").Select ' where the name of the job is
Selection.Copy
Application.Run "Prototype2.xls!Addjob"

Sheets("Job").Select
Range("C29").Select
ActiveSheet.Paste ' copying name of the job to another sheet to

populate
a combo box using data validation and a list
Application.CutCopyMode = False
Selection.Insert Shift:=xlDown
Range("B10").Select

Sheets("NewJob").Select
ActiveSheet.Range("C8:E8") = ""
ActiveSheet.Range("C10:d10") = ""
ActiveSheet.Range("C12") = ""
ActiveSheet.Shapes("Comments").Select
Selection.Characters.Text = ""
ActiveWorkbook.Save

Each time a sheet is copied the new sheet is named "New Job (2)" or (3)

etc.
I either want a method of matching the job name on the sheet to the

sheetname
or a method of changing the sheetname to the job name.

Any suggestions??? Would greatly appreciate it.

Nathan




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
MATCHING A VALUE IN A CELL TO A COLUMN OF VALUES IN ANOTHER SHEET carrach Excel Discussion (Misc queries) 3 February 6th 10 04:32 PM
Matching column in different sheet Khawajaanwar Excel Discussion (Misc queries) 1 December 13th 09 02:21 PM
List matching data from sheet 1 in sheet 2 Thrain Excel Worksheet Functions 4 December 2nd 05 07:11 PM
Matching data and linking it to the matching cell yvonne a via OfficeKB.com Links and Linking in Excel 0 July 13th 05 07:30 PM
click cell and open matching value in next sheet paul Excel Programming 2 November 19th 03 06:54 AM


All times are GMT +1. The time now is 11:30 PM.

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

About Us

"It's about Microsoft Excel"