Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Worksheets.Add.name = range_s after:=Worksheets(Worksheets.Count)
Comes up with the error 'Compile error - Expected end of statement' Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Putting the "name" at the end should do it.
Worksheets.Add(After:=Worksheets(Worksheets.Count) ).Name = "Test" -- Dana DeLouis Win XP & Office 2003 "Bob Phillips" wrote in message ... 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can also do it this way:
Sub AddSheet() range_s = "NewSheet" Worksheets.Add(after:=Worksheets(Worksheets.Count) ).Name = range_s End Sub "Bob Phillips" wrote in message ... 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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I live and learn <vbg
Bob "Tom Ogilvy" wrote in message ... You can also do it this way: Sub AddSheet() range_s = "NewSheet" Worksheets.Add(after:=Worksheets(Worksheets.Count) ).Name = range_s End Sub "Bob Phillips" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Whats Wrong with this?? | Excel Worksheet Functions | |||
whats wrong with this code | Excel Programming | |||
Whats wrong? | Excel Programming | |||
Whats wrong with this code | Excel Programming | |||
What's wrong with this line of code? | Excel Programming |