Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Adding Worksheets

Hi

I am creating an Add-in. This Add-in functions will run on
top of a workbook of data. How do I add a new worksheet in
active workbook with the name "Result" from a function in
the Add-In.
I tried the following but it does not work
ThisWorkBook.Sheets.Add

Also how to ensure that it already does not exist

I use Excel 2002 on Win 2000

Please advise
Thanks a lot
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Adding Worksheets

Hi Peter

Try ActiveWorkbook.Sheets.Add

Cheers,
Flemming


"Peter" wrote in message
...
Hi

I am creating an Add-in. This Add-in functions will run on
top of a workbook of data. How do I add a new worksheet in
active workbook with the name "Result" from a function in
the Add-In.
I tried the following but it does not work
ThisWorkBook.Sheets.Add

Also how to ensure that it already does not exist

I use Excel 2002 on Win 2000

Please advise
Thanks a lot



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Adding Worksheets

Thanks but how do I add a sheet with a particular name

-----Original Message-----
Hi Peter

Try ActiveWorkbook.Sheets.Add

Cheers,
Flemming


"Peter" wrote in

message
...
Hi

I am creating an Add-in. This Add-in functions will run

on
top of a workbook of data. How do I add a new worksheet

in
active workbook with the name "Result" from a function

in
the Add-In.
I tried the following but it does not work
ThisWorkBook.Sheets.Add

Also how to ensure that it already does not exist

I use Excel 2002 on Win 2000

Please advise
Thanks a lot



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Adding Worksheets

Try this:

Set NewSheet = ActiveWorkbook.Sheets.Add
NewSheet.Name = "Results"

Regards,
Patricia
-----Original Message-----
Hi Peter

Try ActiveWorkbook.Sheets.Add

Cheers,
Flemming


"Peter" wrote in

message
...
Hi

I am creating an Add-in. This Add-in functions will run

on
top of a workbook of data. How do I add a new worksheet

in
active workbook with the name "Result" from a function

in
the Add-In.
I tried the following but it does not work
ThisWorkBook.Sheets.Add

Also how to ensure that it already does not exist

I use Excel 2002 on Win 2000

Please advise
Thanks a lot



.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Adding Worksheets

With Activeworkbook.Worksheets
.Add(after:=.count).Name = "ABCD"
End With

--
Regards,
Tom Ogilvy

"Peter" wrote in message
...
Thanks but how do I add a sheet with a particular name

-----Original Message-----
Hi Peter

Try ActiveWorkbook.Sheets.Add

Cheers,
Flemming


"Peter" wrote in

message
...
Hi

I am creating an Add-in. This Add-in functions will run

on
top of a workbook of data. How do I add a new worksheet

in
active workbook with the name "Result" from a function

in
the Add-In.
I tried the following but it does not work
ThisWorkBook.Sheets.Add

Also how to ensure that it already does not exist

I use Excel 2002 on Win 2000

Please advise
Thanks a lot



.





  #6   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Adding Worksheets

Hi Tom
It gives out the follwoing error

Method add of object 'sheets' failed

Please advise
also once its working how not to add (trap error) if the
name already exist.

Thanks a lot in advance for your help
-----Original Message-----
With Activeworkbook.Worksheets
.Add(after:=.count).Name = "ABCD"
End With

--
Regards,
Tom Ogilvy

"Peter" wrote in

message
...
Thanks but how do I add a sheet with a particular name

-----Original Message-----
Hi Peter

Try ActiveWorkbook.Sheets.Add

Cheers,
Flemming


"Peter" wrote in

message
...
Hi

I am creating an Add-in. This Add-in functions will

run
on
top of a workbook of data. How do I add a new

worksheet
in
active workbook with the name "Result" from a

function
in
the Add-In.
I tried the following but it does not work
ThisWorkBook.Sheets.Add

Also how to ensure that it already does not exist

I use Excel 2002 on Win 2000

Please advise
Thanks a lot


.



.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Adding Worksheets

Thanks a lot it worked
-----Original Message-----
Try this:

Set NewSheet = ActiveWorkbook.Sheets.Add
NewSheet.Name = "Results"

Regards,
Patricia
-----Original Message-----
Hi Peter

Try ActiveWorkbook.Sheets.Add

Cheers,
Flemming


"Peter" wrote in

message
...
Hi

I am creating an Add-in. This Add-in functions will

run
on
top of a workbook of data. How do I add a new

worksheet
in
active workbook with the name "Result" from a function

in
the Add-In.
I tried the following but it does not work
ThisWorkBook.Sheets.Add

Also how to ensure that it already does not exist

I use Excel 2002 on Win 2000

Please advise
Thanks a lot



.

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
globally adding a value across worksheets Karina M ) Excel Discussion (Misc queries) 6 October 21st 09 10:00 PM
Adding Across WorkSheets computerangel Excel Worksheet Functions 0 July 8th 08 06:08 PM
Adding formulas across Worksheets Belle[_2_] Excel Worksheet Functions 2 February 4th 08 02:00 PM
adding worksheets sorab Excel Discussion (Misc queries) 1 September 5th 06 02:41 PM
adding worksheets together Gary Excel Discussion (Misc queries) 1 June 27th 05 08:26 PM


All times are GMT +1. The time now is 11:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"