How to automatically add a worksheet using macro?

Can I add adding a worksheet in a macro? How do I do that?
Ex. I create a new macro. One of the steps in my macro is to insert a new 
worksheet.


0
Eva (12)
12/5/2007 11:12:00 AM
excel 39879 articles. 2 followers. Follow

2 Replies
344 Views

Similar Articles

[PageSpeed] 1

Dim NewWks as worksheet
set NewWks = worksheets.add
with newwks
  .name = "Your New Name Here"
  .range("A1").value = "Hi there"
End with


eva wrote:
> 
> Can I add adding a worksheet in a macro? How do I do that?
> Ex. I create a new macro. One of the steps in my macro is to insert a new
> worksheet.

-- 

Dave Peterson
0
petersod (12005)
12/5/2007 12:27:56 PM
Thank you

"Dave Peterson" wrote:

> Dim NewWks as worksheet
> set NewWks = worksheets.add
> with newwks
>   .name = "Your New Name Here"
>   .range("A1").value = "Hi there"
> End with
> 
> 
> eva wrote:
> > 
> > Can I add adding a worksheet in a macro? How do I do that?
> > Ex. I create a new macro. One of the steps in my macro is to insert a new
> > worksheet.
> 
> -- 
> 
> Dave Peterson
> 
0
Eva (12)
12/6/2007 1:49:00 AM
Reply:

Similar Artilces:

Can I add a domain to the Blocked Senders list?
I am just getting used to Outlook 2003 and trying to make use of the SP{AM filter. I see that when I right click on a message that one of the options id to add a sender to the "Blocked Senders List" Is there a way that I can also include the option to block a domain? Thanks Dunc Dunc wrote: > Is there a way that I can also include the option to block a domain? There is an easy way, if you're running Outlook 2003+SP1. Dunc wrote: > Is there a way that I can also include the option to block a domain? Right-click on any e-mail, choose (menu) Junk Mail, Junk Mail...

Macro Security #2
Hi, I am trying to set the Macro security level to Low in Access 2003 but cannot find the option in the Tools\Macro menu. It is not even grayed out. The install is a complete install of Office 2003 and I tried a Detect and Repair without luck. Any suggestions? Thank you. Maybe a post in one of the Access newsgroups would get you an answer quicker. Clementius wrote: > > Hi, > I am trying to set the Macro security level to Low in Access 2003 but cannot > find the option in the Tools\Macro menu. It is not even grayed out. The > install is a complete install of Office 2003 ...

Replying to Individual in Newsgroup using Outlook, with O.E. as NG reader
I'm using Outlook 2000 sp1 for E-mailing. It's set-up to use Outlook Express 6 as the newsgroup reader (whilst calling itself Outlook Newsreader). I recently wanted to reply to an individual in a thread. Everything seemed to go okay until I checked the 'Sent Items' of Outlook. There was an E-mail to the individual, but none of the text that I'd included was there, only the original newsgroup message. Does anybody know what's going on, how to fix it, or has anybody got any suggestions ? Thanks in Advance Duncan Anderson O/S = Win X/P home sp1 I think this happens be...

Add item discounting to inventory wizard
It would be infinately useful for me to be able to assign volume discounts to items based on MPQ and Regular, A, B, and C prices. For example. I sell an item that comes in a box quantity of 25. If a customer at any price level buys 25, the system discounts the item 10%. As it is now, I must go through item by item and enter this information. In my situation, I have thousands of items to update every time prices change. So it would be nice to simply say "if [MPQ] of item is purchased, discount 10%". ---------------- This post is a suggestion for Microsoft, and Microsoft r...

What's the correct procedure to use a CBitmapButton in a dialog (to avoid resouce leaking)?
Hi, I have a CBitmapButton member in a dialog. The problem is that, after exiting my program, there is a cross button staying on my windows 2000's desktop now. The button is exactly the one I used in the dialog. Clicking on it doesn't do anyting. Rebooting the machine doesn't help. The application has been mailed to many customers. Now I expect they'll see this button on their machine but hardly guess that it's caused by my program. In DoDataExchange(), I associate the CBitmapButton member with a push button in the dialog's template. Then in OnInitDialog...

Error when using RMS EDC Settle function
Hello. We run RMSsp2, and use PCCharge PaymntSvr EDC software/First Data processor. PCCharge settles fine, if trying from within RMS, receive error on: 1st attempt: "Invalid Merchant" box error appears. 2nd and subsequent attempts "Invalid Destination Zip" box error appears. Erro occurs withing few seconds of settle attempt, settle progress doesnt go beyond 1/10 of progress meter and this error pops up. Any ideas? Our EDC config is fine and all batches and items are ok in PCCharge. thanks luke ...

Unable to attach an attachment using mail merge
Anyone know how to do an Outlook mail merge and have it sent an attachment to all merged recipents? I put the attachment into the basic outlook e_mail message and when it merges it strips off the attachment. I am using Word as the E-Mail editor and Outlook 2002 SP2 and merging contacts directly from an Outlook Contact folder. ...

How to use MFC Cstring class in Win32 DLL?
Hello all I am having WIN32 DLL and i have to use CString in it. I tried include <Afx.h> with project setting with both 'use MFC in a static library' as well as 'use MFC in a shared library' option of project setting but firstly i got error fatal error C1189: #error : WINDOWS.H already then i commented #include<windows.h> after that i am getting linking error mfcs42d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in testdll.obj Debug/testdll.dll : fatal error LNK1169: one or more multiply defined symbols found i tried other options like includi...

Data entered from list automatically enters number in another cell
I am using Excel 2007 and here is an simplified example of what I need. Items Price Potatoes 4.35 Apples 5.55 Oranges 7.95 Onions 4.55 Carrots 3.75 Items Column is List for Valid entries in table below Prices are the numbers I want entered when I enter the Item If I enter Oranges from Dropdown List in A16 , I want Excel to automatically enter the number 7.95 3 columns over in D16,or if it is quite a bit easier, just 1 column over in cell B16 Example of table I want: My Entries: Excel Enters ...

Prevent auto recoloring of chart when using Pivot Table data
I have crated a Pivot tabel with data I want to show in a Chart. My problem is when I refresh data the colours of the "data series" changes. For exaple I want one of my series "OK" always be shown in green colour, but after a refresh of pivot all colours changes. This problem is not only colouring. If I have made changes to my chart so that one series ar plotted on a secondary axis, and I change it to another chart type (e.g. the secondary should be shown as a line instead of column) this also changes when refreshing the data. Most irritating! Anyone that knows how to p...

solver and macros #2
Before you use the solver within a macro, you must establish a reference to the Solver add-in. With a Visual Basic module active, click References on the Tools menu, and then select the Solver.xla check box under Available References. If Solver.xla doesn't appear under Available References, click Browse and open Solver.xla in the \Office\Library subfolder. Cheers Nick ...

Automatic CC/BB from the Exchange 2003
How can i add automatic cc/bcc for a particular email ID, from the server end The server being used is Exchage 2003 Thanks in advance RSD On 19 May 2005 20:42:31 -0700, "ray_da" <rayo.dalal@gmail.com> wrote: >How can i add automatic cc/bcc for a particular email ID, from the >server end > >The server being used is Exchage 2003 > > > > >Thanks in advance >RSD This depends on exactly what you want to achieve. You could take a look at this: http://www.ivasoft.biz/sj.shtml but it might not be what you want as the requirement wasn't too cle...

uninstall from command line using alternate credentials
WinXP SP3. Is there a way to do this? I am trying to find a way for a power user to uninstall a program using the msiexec + uninstall string from the registry using admin account credentials. Alternativly, I have tried to get the user to do a "run as" on the appwiz.cpl file but I get an error. UPDATE: also tried making a shortcut and running as admin but there is still an error with starting the msiexec. It says something like error statring program, it may be disabled or have no associated programs. I checked the windows installer service and it is running. ...

Printing 2 worksheets to a 2 sided document
Is there any way to print - front to back - 2 seperate worksheets? Turn the paper over and print the second worksheet???? Maybe you can create a worksheet with a picture of both ranges on it: Insert a new worksheet Edit|copy the first range shift-Edit|Paste Picture Link (on that new worksheet) Back for the second range and shift-edit|Paste picture link (right near your first pasted picture link). (insert a nice page break, too) And by pasting a link, you can change the original range and your picture will update right away. (Keep that worksheet as long as you want and print from there???)...

Updating a form after using a workflow rule to update the entity.
I have a workflow rule that, on create of a contact, calls an assembly and updates an attribute of that assembly. It works a treat, but after saving, the attribute does not appear in the form. I have to close and re-open the contact to see the attribute. Is there any way to have this display immediately? Thanks Saira ...

Using Microsoft Map in Office XP
How can I add the add-in Microsoft Map to work in Office XP? Thank you for looking. John John MS Map not available with versions 2002 and 2003. MS Map Point is now the application used. Costs about $250.00 US. An alternate is to use MapInfo product(which was the Excel 97 and 2000 product). Very costly at minimum $595.00 US just for upgrade. http://www.mapinfo.com/location/integration But............found this tidbit on the net thanks to Debra Dalgleish. Mystery of the Missing Map Tool: If you believe Microsoft, the Excel Map tool is permanently out of action in Offi...

Messages in sent folder automatically gets deleted periodically on IMAP account
Windows Mail v6.0.6000.16386 using IMAP on Windows Vista Home Premium Every once a while, my email messages in my "sent" folder for some reason gets automatically deleted. Is there a way I can prevent this from taking place? Other than accessing the account via POP3 instead of IMAP, no. snomazushi wrote: > Windows Mail v6.0.6000.16386 using IMAP on Windows Vista Home Premium > > Every once a while, my email messages in my "sent" folder for some reason > gets automatically deleted. Is there a way I can prevent this from taking > place? ...

Starting a macro by editing a cell
I would like a macro to be initiated whenever someone edits a particula cell, does anyone now how this can be done? Many Thanks, Yianni -- Message posted from http://www.ExcelForum.com Yiannis You would need on change macro in the worksheet module Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Target.Address = "$A$1" Then my code gets actioned here if target.value = "" then exit sub end if End If End Su -- Message posted from http://www.ExcelForum.com ...

create new worksheet based on month change
Hi, I have a problem I hope someone can help me with. I have a worksheet for employees to enter data. At the beginning of each month I run a macro which copies a mastersheet to start the new month. The first column of the sheet is for the employee to enter their name. Using code when they move to the 2nd column it automatically inserts the date and the 3rd column the time both based on whether there is an entry in the first column. I want to call my new worksheet macro when the date changes month. I have been trying to use ActiveCell.Offset command to look at the date in the row above but with...

Automatic open locked excel file through access control
We know,Excel has prompt password to open it files. Is it possible to create a code that can supplies the excel prompt password?.So that when we open the excel file through our access control in a form, the excel files can be opened automatically.But when the excel files opened from its default icon,it will prompt a password first. On Jul 10, 8:43 pm, "shiro" <s...@play.com> wrote: > We know,Excel has prompt password > to open it files. > Is it possible to create a code that can > supplies the excel prompt password?.So that when we > open the excel file throu...

problem while using excel
hi, exel sheet displaying page number in background in each and every cell of my sheet in background And displaying message first while opening the sheet as "margins doesn't fit can you please help me with this issue?? View > Normal -- Gary''s Student - gsnu200786 While i am using excel, when i try to copy and paste words, the program becomes very sluggish. very laggy and slow. how do i resolve this? You probably have a lot of formulae, go to TOOLS>OPTIONS>CALCULATION and change it to manual, you can then calculate the workbook by pressing F9, take a look ...

Clear cell value without macro?
Is there any way to clear a cell value when the sheet is selected or the workbook opened without using a macro? Ed Click on the cell and press the <delete> key. Is this what you mean? Pete On Dec 9, 1:44=A0pm, Ed from AZ <prof_ofw...@yahoo.com> wrote: > Is there any way to clear a cell value when the sheet is selected or > the workbook opened without using a macro? > > Ed > On Dec 9, 1:44 pm, Ed from AZ wrote: > > Is there any way to clear a cell value when the sheet is selected or > > the workbook opened without using a macro? On Dec 9, 7:02=A0a...

Weed out words using Excel??
Is there a way to automatically isolate an appearance of a word in list of words, eg I have a full dictionary of words, and I want to end up wit a list where the word (for example) "log" appears. So if the big lis contains: logarithm chair table catalogue (each on a sepearte line) The list I would want would be: logarithm catalogue (leaving out the others) Thanks -- Message posted from http://www.ExcelForum.com Hi Have a look at Data / Filter / Autofilter. Andy. PS I'd love to know where you got your text file from!! "sensible >" <<sensible.148ne7@exc...

How do I keep the help window on top and work on my worksheet
When working on a sheet in excel, I open the help window and wish to read it whilst making a suitable entry on the page. The help window closes as soon as it loses focus. In earlier versions this did not happen. Is there a fix for it? If you are using Excel 2003, the top left corner of the help-presented window has a Tile/Untile option. Not really pretty but does enable you to read the help whilst working on the sheet. Howard Walker 635 Wrote: > When working on a sheet in excel, I open the help window and wish to > read it > whilst making a suitable entry on the page. The hel...

How do I use alpha page numbers (e.g., B-3a, B-3b, B-3c, etc.) in.
I am using Excel 2003 and need to use incrementing alpha page numbers (e.g., B-3a, B-3b, B-3c, etc.). Excel 2003 help only refers to numeric page numbers. Is there a way to format the page numbers to use incrementing alpha page numbers? I was hoping to see a better reply to your question, but a day has gone by so here is my $0.02. If you must, you can always similate the footer in the worksheet, just have to be consistent with row heights, etc. This might be more trouble than it's worth, but if want to try here's a formula that might help. =IF(QUOTIENT(COLUMN()-1,26)=0,"...