Key Board Shortcuts

Hi, 

I am new to Excel and VBA, I am looking for a keyboard shortcut to select 
all worksheets in an excel workbook. 

(Infact, i am planning to select all worksheets using a keeyboard shortcut 
and then deselect the last worksheet, to delete all the selected worksheets. 
I wish to use this, while i record a macro, to do this everytime i need to 
update my file. Actually before running my macro, which would copy some 
sheets from an open workbook, i need to delete these old sheets.)

Hoping for a reply and guidance soon,
Sincerely,
Sree
0
sreekasi (3)
3/28/2007 3:48:04 PM
excel.newusers 15348 articles. 2 followers. Follow

4 Replies
377 Views

Similar Articles

[PageSpeed] 26

One way, without deselecting:

    Public Sub DeleteAllButLastSheet()
        Dim i As Long
        With ActiveWorkbook.Worksheets
            If .Count > 1 Then
               For i = 1 To .Count - 1
                    .Item(i).Select Replace:=False
                Next i
                On Error Resume Next
                Application.DisplayAlerts = False
                ActiveWindow.SelectedSheets.Delete
                Application.DisplayAlerts = True
            End If
        End With
    End Sub


In article <55FBCF7B-11F5-43F1-823B-67ACAE716A63@microsoft.com>,
 sree kasi <sreekasi@discussions.microsoft.com> wrote:

> Hi, 
> 
> I am new to Excel and VBA, I am looking for a keyboard shortcut to select 
> all worksheets in an excel workbook. 
> 
> (Infact, i am planning to select all worksheets using a keeyboard shortcut 
> and then deselect the last worksheet, to delete all the selected worksheets. 
> I wish to use this, while i record a macro, to do this everytime i need to 
> update my file. Actually before running my macro, which would copy some 
> sheets from an open workbook, i need to delete these old sheets.)
> 
> Hoping for a reply and guidance soon,
> Sincerely,
> Sree
0
jemcgimpsey (6723)
3/28/2007 4:11:05 PM
That was super, it worked fine with my objective. Is it possible to record 
that using a reader, or is it a real VB Program. Please let me know. I wish 
to learn more.

"JE McGimpsey" wrote:

> One way, without deselecting:
> 
>     Public Sub DeleteAllButLastSheet()
>         Dim i As Long
>         With ActiveWorkbook.Worksheets
>             If .Count > 1 Then
>                For i = 1 To .Count - 1
>                     .Item(i).Select Replace:=False
>                 Next i
>                 On Error Resume Next
>                 Application.DisplayAlerts = False
>                 ActiveWindow.SelectedSheets.Delete
>                 Application.DisplayAlerts = True
>             End If
>         End With
>     End Sub
> 
> 
> In article <55FBCF7B-11F5-43F1-823B-67ACAE716A63@microsoft.com>,
>  sree kasi <sreekasi@discussions.microsoft.com> wrote:
> 
> > Hi, 
> > 
> > I am new to Excel and VBA, I am looking for a keyboard shortcut to select 
> > all worksheets in an excel workbook. 
> > 
> > (Infact, i am planning to select all worksheets using a keeyboard shortcut 
> > and then deselect the last worksheet, to delete all the selected worksheets. 
> > I wish to use this, while i record a macro, to do this everytime i need to 
> > update my file. Actually before running my macro, which would copy some 
> > sheets from an open workbook, i need to delete these old sheets.)
> > 
> > Hoping for a reply and guidance soon,
> > Sincerely,
> > Sree
> 
0
sreekasi (3)
3/28/2007 5:14:01 PM
XL Macros are recorded as VBA commands, so there's really no difference 
between macros and "real" VBA.

However, there are a lot of things that cannot be recorded, including 
for...next loops and the .DisplayAlerts commands. I rarely use the 
recorder any longer.

You can find out more about macros here:

    http://www.mvps.org/dmcritchie/excel/getstarted.htm

In article <36FA40FD-B674-49FC-B475-DCA3A2C261AB@microsoft.com>,
 sree kasi <sreekasi@discussions.microsoft.com> wrote:

> That was super, it worked fine with my objective. Is it possible to record 
> that using a reader, or is it a real VB Program. Please let me know. I wish 
> to learn more.
0
jemcgimpsey (6723)
3/29/2007 3:41:56 AM
Thank you very much for your help, i wish to be in touch.

"JE McGimpsey" wrote:

> XL Macros are recorded as VBA commands, so there's really no difference 
> between macros and "real" VBA.
> 
> However, there are a lot of things that cannot be recorded, including 
> for...next loops and the .DisplayAlerts commands. I rarely use the 
> recorder any longer.
> 
> You can find out more about macros here:
> 
>     http://www.mvps.org/dmcritchie/excel/getstarted.htm
> 
> In article <36FA40FD-B674-49FC-B475-DCA3A2C261AB@microsoft.com>,
>  sree kasi <sreekasi@discussions.microsoft.com> wrote:
> 
> > That was super, it worked fine with my objective. Is it possible to record 
> > that using a reader, or is it a real VB Program. Please let me know. I wish 
> > to learn more.
> 
0
sreekasi (3)
3/29/2007 8:38:00 AM
Reply:

Similar Artilces:

Create Registry key under HKEY_LOCAL_MACHINE in XP
Hi, I would like to create a Sub key under HKEY_LOCAL_MACHINE but I found that I need to have a permission (access right to create sub key). How do I create a sub key under the HKEY_LOCAL_MACHINE? How do I set the permission in order to have the right to create sub key programmatically? Thanks for any helps. You need administrator privileges. "GP Chong" <GPChong@noemail.com> wrote in message news:OVdaWMs%23DHA.2480@TK2MSFTNGP12.phx.gbl... > Hi, > I would like to create a Sub key under HKEY_LOCAL_MACHINE but > I found that I need to have a permission (access...

creating modeless dlg in OCX causes msg pump shutout when keys pressed
I've created an OCX in VC 6.0 using the appwizard. I've inserted a simple dialog class into the ocx's application called MyDialog and have attatched a CDialog derived class to the dialog resource. In the COleControl derived class (which I call CModelessDlgOCXCtrl) I've added a method to the control's interface called PopupDlg(). The code for this method is as follows... MyDialog *pdlg = NULL; long CModelessDlgOCXCtrl::PopupDlg() { pdlg = new MyDialog; pdlg->Create(IDD_DIALOG1,this); pdlg->ShowWindow(SW_SHOW); return 0; } Note that the pdlg po...

new desktop shortcut fAils with data protection error
Computer; windows xp sp3 internet explorer 7 solid state hard drive, sata second drive. New desktop shortcut to second drive when you double click it brings up a data protection error. If you right click and go to open it brings up the open with dialoug box. All of the original shortcuts work correctly. Only a problem with the ones that were made with in the past 3 weeks. Loretta Loretta, the drive opens fine when you try from MyComputer? When you rt click the shortcut does it show you properties dialog box with path of target ( sata drive )? Or, when rt click...

activation key
I purchased excel 2007 update last year. i have installed on 5 of my computers. one of them crashed. i now have a new computer. after i installed on my new computer and then activated. i get a message that i have installed my final time. I have one computer that i installed as a backup. can i uninstall from that computer and reinstall on my new computer that i will be using all of the time? If i have to purchase a new upgrade again, do i have to uninstall then reinstall, or can i just change the activation keys, and if so , where do i go to do that.. Please help...been trying for...

Word, Form Fields, and the Enter Key
I've posted once on this subject, with no reply. I thought I'd try again in a different format. I'm using the code below to act like the Tab Key to go between Form Fields. The problem is that when using the Enter Key, the Form Fields are not Formatted, as they are with the Tab Key. Please, someone copy this code into a blank worksheet and try it yourself, format some Form Fields, and tell me why the code is not formatting the Form Fields. By the way, after using the Enter Key, if I go back to the previous Form Field by using the left arrow or mouse, for example and...

What is the shortcut for switching between worksheets?
I would like to find out what is the shortcut for switching between worksheets in the same workbook Hi there. Using Ctrl + Page Down moves to the sheet to the right. If using Ctrl + Page Up, this will move to the sheet to the left. Hope this is of some help. Ellie "DJALik" wrote: > I would like to find out what is the shortcut for switching between > worksheets in the same workbook ...

Tab keys and accelerators don't work in mfc regular dll
I am wondering why I can't get tab keys or accelerators to work in a mfc regular dll my main application is calling. It doesn't matter if mfc is statically linked or shared. Raj ...

adjusting formula totals with tab or arror keys
I used to be able to see the "newly" adjusted totals on my spreadsheets after moving to the next line, via the arrow down key or tab key. Now only after saving are the New totals adjusted on the sheet? Why? Perhaps the calc mode was inadvertently changed to "Manual / Recalc before save" ? Click Tools > Options > Calculation tab Ensure that "Automatic" box is checked > OK -- Rgds Max xl 97 --- GMT+8, 1� 22' N 103� 45' E xdemechanik <at>yahoo<dot>com ---- "Susan" <Susan@discussions.microsoft.com> wrote in messa...

Please Help with Multiple Field Primary Keys
I have two tables in a database that have to use four fields for a unique identifier and primary key. How do I set up a query to set a relationship between those four fields together as one? When I add the tables to the query I see the fields, but I am not having any success properly setting the relationships. The upper half of the query design window is where the 2 tables appear. Drag Field1 from Table1, and drop it into Field1 from Table2. Access displays a join line from one table to the other. Drag Field2 from Table1, and drop it into Field2 from Table2. Repeat for the other 3 f...

my arrow keys are behaving strangely
The arrow keys always moved from cell to cell. Now they move the entire worksheet up, down, left, right. I must have done something to make this happen, but I can't figure out how to correct it. I'm sure it's stupid simple. Please help. thanks. Tap the Scroll Lock key on your keyboard. Missing Pieces wrote: > > The arrow keys always moved from cell to cell. Now they move the entire > worksheet up, down, left, right. I must have done something to make this > happen, but I can't figure out how to correct it. I'm sure it's stupid > simple. Please hel...

Unable to Enter New Product Key During Installation of Office 2008
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: Intel I just purchased a second Mac for my home. During the configuration of the second Mac at the Apple Store, they installed Office 2008 (I had already used one product key to install on my other home computer). When I tried to use Office applications on the original computer, a dialog box told me that I had used my licenses. I think what happened is that the Mac store used the same product key that I used for the original installation on my first machine. As per directions on this site, I have uninstalled Office 2008, includ...

Foreign Key problem
Can't get an insert to work with linked tables. I need both tables to be updated with a primary key and matching foreign key on insert. For the sake of simplicity, I have two tables, tbl1 and tbl2. tbl1 tbl1_pk primary key field1 field2 tbl2 tbl2_pk tbl1_fk foreign key field3 field4 Without a relationship defined, running a join query on tbl2.tbl1_fk=tbl1 _pk (it's a left out join, tbl1 is left) as record source to a form. On the form, on an insert, filling any tbl1 value (field1 or field2) creates a primary key for tbl1 (expected) but ONLY if enter a val...

Outlook 2003 Shortcuts #6
You experienced peolple have probably heard it all before, but I can't find a solution. I have always used Outlook 2000 and like the Outlook bar. I have tried to replicate this in Outlook 2003 by using the Shortcuts option and changing the WunderBar option to 6 etc. However, the registry keeps changing itself back to 0. The second problem is that I don't see the shortcuts list in Calendar. Does anyone have any ideas please? ...

Strange Tab Key Behavior
I have a userform with about 20-30 textboxes. When users use the ta key to navigate, it will work, then all of a sudden just stop. The ta stays inside the textbox and tabs over spaces inside the userfor textbox, but it does not jump to the next box. This seems to b intermittent, if the user restarts the form, it goes away, bu eventually it sometimes returns to this weird behavior. Has anyon come across this, i am puzzled?? -- Message posted from http://www.ExcelForum.com There's a tabkeybehavior property that sounds like is set to true for some and false for others. If you select t...

Arrow Keys DO NOT Work Properly
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Why do my arrow keys move the entire page down or up rather than moving the active cell up or down or sideways? What can I do to fix this? Only happened since I purchased the newer version 2008. Thanks Apply the 12.2.3 update to Microsoft Office, then post back and we can help you resolve the issue. On 20/12/09 10:29 AM, in article 59baf6cd.-1@webcrossing.JaKIaxP2ac0, "Black_Magic@officeformac.com" <Black_Magic@officeformac.com> wrote: > Version: 2008 Operating System: Mac OS X ...

Primary Key Wont show on form
In Dynamics CRM, i want to customize a form and we would like to have the form show the primary key on the from itself. When I go to settings -> custom entities -> (any form) they will all have a primary key that I can see in attrivutes. But when I go to "form and views" - > "form" and try to add in the primary key into the form it doesn't show. Is it possible to show the primary key on the form? Option 2 i guess would be to make an auto-number. But it seems redundant to make an autonumber when I assumed windows has already done that. Any suggestions? ...

batch RM_OPEN duplicate key
We on on Dynamics GP v9.00.0281 We had a batch die and I was asked to look into it. This is what I found. I go into Batch Recovery and it is listed. BatchID: "LK ARII-2/3" Origin: Receivables Sales Entry Status: Posting Interrupted I check the box and click on continue. It starts running then pops up with: Batch LK ARII-2/3 failed to complete posting, Use the Batch Recovery window to complete the process More Info shows: A save operation on table 'RM_OPEN' has created a duplicate key. Any ideas on what I need to do to get this corrected? -- ToddR do a backup first , t...

My product key is incorrect how do I resolve this problem?
My laptop came with Microsoft word 2007. Microsoft word tells me to put in my product key. So i put in the product key that is located on the bottom of my laptop but for some reason it says it's incorrect how do i resolve this? The product key on the bottom of your laptop is undoubtedly for Windows and not Word. Laptops often come with a trial version of Office 2007. Unless you paid extra for a retail version of the Office software it may be that your trial has now expired. -- <>>< ><<> ><<> <>>< ><<> <>>...

Shift key to disable macros not working
I have a macro that runs upon opening a file. I believe that holding down the shift key is supposed to disable automatic macros. It is not disabling. Any suggestions? -- David P. Try to open Excel in Safe Mode (Uisng /s) -- Gary's Student "David P." wrote: > I have a macro that runs upon opening a file. I believe that holding down the > shift key is supposed to disable automatic macros. It is not disabling. Any > suggestions? > -- > David P. You might try setting your macro security to Medium. -- Jim "David P." <DavidP@discussions.microso...

how do i find my product key help i gotta do homework
how do i find my product key Go online and download Belarc Advisor. Load it on your machine and it will give you all the product keys on your machine. (winXP) "help" wrote: > how do i find my product key On Tue, 13 Nov 2007 12:20:03 -0800, help <help@discussions.microsoft.com> wrote: >how do i find my product key It's printed in great big black letters on a yellow background on the label on the CD/DVD case.... if you have a legal copy of the software. John W. Vinson [MVP] ...

Outlook shortcut bar #2
I just can't seem to find a way to do this and am hoping that someone here has some good ideas for me. I have a user that has a bunch of short cuts in his outlook shortcut bar. I am switching his PC and and want to know if those shortcuts are contained in a file that I can just copy to the new machine? Thanks in advance for any info! The Outlook Bar shortcuts are stored in the ---.FAV file (where "---" is the name of your profile). -- PATRICK REED [Outlook - MVP]~~~~~~ -Microsoft Certified Professional (MCP) -Have you checked http://www.slipstick.com? -Please post ...

Looking for lost free shortcut icons
Some time ago I had found a collection of icons that could be used for shortcut menus and other uses. They were a very nice set for free and not the usually cutsey crap that seems to be out there. Since then I seemed to have deleted the file and have no reference to where I found them. I was hoping someone here might remember having seen them and know where I can go to download them again. Here is a pic of some of the icons I used from that collection - maybe these will ring a bell for you. http://www.pensioninsider.com/images/dev_icons.gif Any help would be appreciated Thanks Tony ...

Keyboard Shortcut for Zooming
Hi all, I am a keyboard shorcut freak and would love to know if there is a shortcut key to zoom a sheet in and out. If not, should I record a macro to do this, I can do basic record functions but am unsure as to how I can record zooming in and out. Can anyone help? Not exactly a keyboard shortcut, but have you tried: <Tools> <Options> <General> tab, And click on "Zoom On Roll With Intellimouse" ? -- HTH, RD ============================================== Please keep all correspondence within the Group, so all may benefit! =================================...

Shortcut
Is there any keyboard shortcut available for expanding distribution reference? Hari Hari, Make a macro (Tools > Macro > Record) of yourself doing it, add that macro to the shortcut pane on the left and assign a keyboard shortcut to it. -- Japheth Nolt Landis Computer www.landiscomputer.com PC Sales, Service & Helpdesk Certified Network Installation & Service Microsoft Retail Management System Microsoft Small Business Financials Specialists Microsoft Certified Partner Comp TIA PC Service Certified "Hari" <Hari@discussions.microsoft.com> wrote in me...

VBA
Can you trap the keyup or keydown events at the application level using VBA? if so, how is that done? You might want to subclass PowerPoint's main window and see if the messages that you get are the ones you want to handle. An example of how to subclass PowerPoint's main window is available at http://officeone.mvps.org/vba/subclass_powerpoint.html - Chirag PowerShow - View multiple PowerPoint slide shows simultaneously http://officeone.mvps.org/powershow/powershow.html "George Lee" <GeorgeLee@discussions.microsoft.com> wrote in message news:5A9...