View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.newusers
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default How to use VBA to name sheet ?

I would advise against suggesting that variables are not declared, poor
programming practice. The problem is that it should be declared as Worksheet
against Worksheets, not that it shouldn't be declared.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"SteveW" wrote in message
news:op.tc88mtjcevjsnp@enigma03...
Works perfectly without the Dim statment - not needed

Steve

On Tue, 25 Jul 2006 16:57:09 +0100, vumian
wrote:


Dim sh As Worksheets
Sub GetName()
For Each sh In ActiveWorkbook.Worksheets
sh.Name = sh.Range("C4").Value
Next sh
End Sub


It do not run.
Why, help me pls





--
Steve (3)