Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Worksheet
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=566704 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Worksheet
I do the same thing all the time. You have to say Sheets(Sheets.Count), not
just Sheets.Count, to return a reference to the final sheet. This works: Sub test() Dim wks As Worksheet Set wks = Worksheets.Add(After:=Sheets(Sheets.Count)) wks.Name = "taz" End Sub Hope this helps, Hutch "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=566704 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
automatically appending newly added data on worksheet to a master list worksheet | Links and Linking in Excel | |||
Unable to Insert Worksheet/Move and copy worksheet Excel 2003 | Excel Worksheet Functions | |||
plot graph from multiple worksheet as embedded chart object on every worksheet | Charts and Charting in Excel | |||
Upload multiple text files into 1 excel worksheet + put the filename as the first column in the worksheet | Excel Worksheet Functions | |||
Attaching a JET database to an Excel Worksheet OR storing large binary data in a worksheet | Excel Programming |