View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Whats wrong with this line of code?

Edgar,

Don't think you can name it and place it in one statement. Try

Set oWs = Worksheets.Add(after:=Worksheets(Worksheets.Count) )
oWs.Name = range_s


--

HTH

RP

"Edgar Thoemmes" wrote in message
...
Worksheets.Add.name = range_s after:=Worksheets(Worksheets.Count)

Comes up with the error 'Compile error - Expected end of statement'

Thanks