Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Changing cell values based on a worksheet name

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Changing cell values based on a worksheet name

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))

" 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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Changing cell values based on a worksheet name

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

" 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
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
Formula for changing cell format based on more than 3 values Francisco Rodriguez[_2_] Excel Worksheet Functions 3 February 12th 10 04:14 PM
Add a row and totals based on changing cell values Paul Excel Worksheet Functions 2 July 7th 09 05:08 PM
Changing values in cell based on system date [email protected] Excel Worksheet Functions 2 October 24th 08 07:33 AM
Changing values in a row based on a cell in the row. Casey Excel Discussion (Misc queries) 2 September 14th 05 03:23 PM
Changing cell colors based on values Jon Willits Excel Programming 3 February 29th 04 08:06 PM


All times are GMT +1. The time now is 04:52 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"