PC Review


Reply
Thread Tools Rate Thread

Changing cell values based on a worksheet name

 
 
jrp7286@yahoo.com
Guest
Posts: n/a
 
      7th May 2007
I am trying to return a value to a cell base on the name of the
worksheet tab. I have around 300 proucts that I need to have a
separate tab for each product. I have used visual basic to name the
tab, now I need to have that same worksheet name appear in a cell.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?=
Guest
Posts: n/a
 
      7th May 2007
You can do this with or without VBA.

With VBA

dim aWS as worksheet
for each aWS in activeworkbook.worksheets
aws.cells(row,column).value = aws.name 'You fill in the row and column
value
next aws

Without VBA

=RIGHT(CELL("filename",A1),LEN(CELL("filename",A1))-SEARCH("]",CELL("filename",A1),1))

"(E-Mail Removed)" wrote:

> I am trying to return a value to a cell base on the name of the
> worksheet tab. I have around 300 proucts that I need to have a
> separate tab for each product. I have used visual basic to name the
> tab, now I need to have that same worksheet name appear in a cell.
>
>

 
Reply With Quote
 
=?Utf-8?B?TWlrZQ==?=
Guest
Posts: n/a
 
      7th May 2007
try this Put this into the this workbook mod And A1 will be named the same as
sheet name. Im asuming all sheets will have the same cell of Sheet Name
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

If Range("A1") = ActiveSheet.Name Then

Exit Sub
Else
Range("A1").Value = ActiveSheet.Name
End If
End Sub

"(E-Mail Removed)" wrote:

> I am trying to return a value to a cell base on the name of the
> worksheet tab. I have around 300 proucts that I need to have a
> separate tab for each product. I have used visual basic to name the
> tab, now I need to have that same worksheet name appear in a cell.
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing name of worksheet based on data in cell of another worksheet bss5974@yahoo.com Microsoft Excel Programming 14 21st Apr 2011 10:04 PM
Changing Cell Color based upon value on another worksheet DPelletier Microsoft Excel Programming 2 5th Nov 2009 10:24 PM
Add a row and totals based on changing cell values Paul Microsoft Excel Worksheet Functions 2 7th Jul 2009 05:08 PM
Changing values in a row based on a cell in the row. Casey Microsoft Excel Misc 2 14th Sep 2005 03:23 PM
Changing cell colors based on values Jon Willits Microsoft Excel Programming 3 29th Feb 2004 08:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:13 PM.