Thread: Add Worksheet
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Pflugs Pflugs is offline
external usenet poster
 
Posts: 167
Default Add Worksheet

Use this instead:

Sub test()
Worksheets.Add After:=Sheets(Sheets.Count)
ActiveSheet.Name = "taz"
End Sub

You don't need to use an object ("Set wks = ...").

Pflugs

"T De Villiers" wrote:


Hi,the following is a simpe macro to add a worksheet,
just doesnt seem to be working,
mnay thanks

Sub test()
Set wks = Worksheets.Add(After:=(Workbook.Sheets.Count))
wks.Name = "taz"
End Sub


--
T De Villiers
------------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...o&userid=26479
View this thread: http://www.excelforum.com/showthread...hreadid=566705