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

I have a macro which recorded me selecting sheets, then, I record the right
click and hit delete. Then I hit the delete button, but I don't see that it
records anything when I confirm the delete, by hitting the delete button.
How do I tell the macro to confirm the delete operation. Here is the macro
I recorded.

Sheets("Comments").Select
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets(Array("Comments", "Dispersion", "BOPSummary",
"EOPSummary")).Select
Sheets("EOPSummary").Activate
ActiveWindow.SelectedSheets.Delete


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Complete Delete

Application.DisplayAlerts = False
Sheets(Array("Comments", "Dispersion", "BOPSummary", _
"EOPSummary")).Delete
Application.DisplayAlerts = True

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------

I have a macro which recorded me selecting sheets, then, I record the right
click and hit delete. Then I hit the delete button, but I don't see that it
records anything when I confirm the delete, by hitting the delete button.
How do I tell the macro to confirm the delete operation. Here is the macro
I recorded.

Sheets("Comments").Select
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets(Array("Comments", "Dispersion", "BOPSummary",
"EOPSummary")).Select
Sheets("EOPSummary").Activate
ActiveWindow.SelectedSheets.Delete


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default Complete Delete

Grace,

You actually don't confirm the delete, instead you skip the confirmation
prompt altogether.
Use the DisplayAlerts property to turn off the prompt, then turn it back on
after the delete:

Application.DisplayAlerts = False
ActiveWindow.SelectedSheets.Delete
Application.DisplayAlerts = True

hth,

Doug Glancy

"Grace" wrote in message
...
I have a macro which recorded me selecting sheets, then, I record the

right
click and hit delete. Then I hit the delete button, but I don't see that

it
records anything when I confirm the delete, by hitting the delete button.
How do I tell the macro to confirm the delete operation. Here is the

macro
I recorded.

Sheets("Comments").Select
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets(Array("Comments", "Dispersion", "BOPSummary",
"EOPSummary")).Select
Sheets("EOPSummary").Activate
ActiveWindow.SelectedSheets.Delete




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Complete Delete

Looks like you and Doug both agree. And it works, thanks!
G

wrote in message
...
Application.DisplayAlerts = False
Sheets(Array("Comments", "Dispersion", "BOPSummary", _
"EOPSummary")).Delete
Application.DisplayAlerts = True

HTH
Paul
--------------------------------------------------------------------------

------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------

------------------------------------

I have a macro which recorded me selecting sheets, then, I record the

right
click and hit delete. Then I hit the delete button, but I don't see that

it
records anything when I confirm the delete, by hitting the delete button.
How do I tell the macro to confirm the delete operation. Here is the

macro
I recorded.

Sheets("Comments").Select
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets(Array("Comments", "Dispersion", "BOPSummary",
"EOPSummary")).Select
Sheets("EOPSummary").Activate
ActiveWindow.SelectedSheets.Delete




  #5   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Complete Delete

Please understand that this is not meant to come across as
rude or derogatory.

Based on the number of posts you've sent recently, and the
nature of the questions you have asked, perhaps the best
solution for you would be to go to the person that tasked
you with creating/amending the macros and tell them that
you do not have the required knowledge of VBA to do so.
If someone says "Put this at the top of your code module"
and you need to ask "What's a code module?", you shouldn't
be developing important tools for your business.

Stop coding now, nip down to a bookstore and pick up any
of John Walkenbach's books on VBA programming in Excel.
He's written a few, they're all good, and most importantly
they will give you a base level of knowledge to go forward
with.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Complete Delete

Dear anonymous (and everyone else who, understandably, feels as he does):

In hindsight, if I had known it would be this difficult to learn and I would
be such an imposition on the group, I might not have done all this. It does
seem clear that one should have more knowledge than I had, as the answers
seem to presume it. Truth to tell, I am in one of those situations where it
simply had to be turned around quicker than I could ever learn via a
textbook. I actually did 85% of the coding myself, it was the last 15% for
which I needed help. As you can probably tell from the hours of my posts, I
have had very little sleep the last week. If this product weren't deemed
highly proprietary and the data within, client sensitive, I would have been
SOOOO tempted to ask one of you smart and nice folk to do it for me, paying
for it out of my own pocket, despite the fact that my financial situation is
les than stellar now. Also, I hate to be at the mercy of someone else's
code, should they not be available, say, a year from now. So, I felt like I
had to put myself through this experience and learn, which I did.

Here's the good news:

I am waiting on clarifications on two posts (Closing non EXCEL files and
Code Help) and, after that, I should have very, very few questions left. I
hope you are not one of the respondents on those two points. Since you have
posted this anonymously - that is the only thing I find rude, your critique
is, otherwise, surely justified - I cannot know not to bother you again.
You all may not hear from me for a long time after this is done (obviously,
this is not my area of expertise) and, if there is a next time, I will read
the book.

The underlying file is so, so complex, it would be impossible to get the
result right if the code is wrong. And I do test my macro-driven results
against 100s of results I've already done manually. At this point, it is
working flawlessly, though I am still hoping for those two refinements.

Despite a few of the questions, I have learned a LOT.

I am truly indebted to everyone who has been so helpful! I apologize to
anonymous and everyone else I have angered.

Thank you all VERY MUCH!
Grace

wrote in message
...
Please understand that this is not meant to come across as
rude or derogatory.

Based on the number of posts you've sent recently, and the
nature of the questions you have asked, perhaps the best
solution for you would be to go to the person that tasked
you with creating/amending the macros and tell them that
you do not have the required knowledge of VBA to do so.
If someone says "Put this at the top of your code module"
and you need to ask "What's a code module?", you shouldn't
be developing important tools for your business.

Stop coding now, nip down to a bookstore and pick up any
of John Walkenbach's books on VBA programming in Excel.
He's written a few, they're all good, and most importantly
they will give you a base level of knowledge to go forward
with.



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
Complete Tax Years Dan Excel Worksheet Functions 1 December 3rd 09 02:33 PM
Delete cell names on complete workbook deacs Excel Discussion (Misc queries) 2 February 23rd 06 11:43 AM
Copy complete row Joel Excel Worksheet Functions 1 October 28th 05 01:09 AM
Ref from table - complete Steve Excel Worksheet Functions 3 June 23rd 05 06:47 PM
Turn off pdf complete Tony Boyda Setting up and Configuration of Excel 0 June 10th 05 04:01 PM


All times are GMT +1. The time now is 04:27 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"