View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Sheet Name to Cell Value

Hi Halem,

Try:

'=============
Public Sub Tester()
Dim SH As Worksheet

For Each SH In ThisWorkbook.Worksheets
SH.Range("B7").Value = SH.Name
Next SH

End Sub
'<<=============


---
Regards,
Norman


"halem2" wrote in
message ...

Hi:

have a very large workbook with about 200 sheets. Each sheet has a
name. I need to copy the sheet name to cell B7 on that sheet for every
sheet. Does any one has a code for this? I was tryng to use

ActiveSheet.Range("B7").Text = ActiveSheet.Name

but I can't get it to work.




--
halem2
------------------------------------------------------------------------
halem2's Profile:
http://www.excelforum.com/member.php...fo&userid=9930
View this thread: http://www.excelforum.com/showthread...hreadid=556975