Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 4,624
Default Key Board Shortcuts

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 ,
sree kasi 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

  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3
Default Key Board Shortcuts

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 ,
sree kasi 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


  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 4,624
Default Key Board Shortcuts

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 he

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

In article ,
sree kasi 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.

  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3
Default Key Board Shortcuts

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 he

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

In article ,
sree kasi 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.




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
Tally Board Alexa Charts and Charting in Excel 1 January 12th 07 03:33 PM
how can we drug some one with the help of key board ankit varshney Excel Discussion (Misc queries) 2 September 11th 06 08:16 PM
MS Word Message Board? tkaplan Excel Discussion (Misc queries) 2 September 2nd 05 06:19 PM
Assigning Key Board Shortcuts !! Shrikant Excel Discussion (Misc queries) 2 August 22nd 05 12:57 PM
Key-Board ShortCut Jim May Excel Discussion (Misc queries) 3 February 26th 05 09:44 PM


All times are GMT +1. The time now is 10:59 PM.

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

About Us

"It's about Microsoft Excel"