View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Input box for excel tab

Instead of asking for the sheet name (and having to check for typos), why not
just give them a little prompt saying that the activesheet will be cleaned up?

dim resp as long
resp = msgbox(prompt:=activesheet.name & " will be cleaned up, ok?", _
buttons:=vbyesno)

if resp = vbno then
exit sub
end if

'rest of your macro.

======
Personally, I'd just make sure that the users know that the macro works against
the activesheet. Seems pretty reasonable to me--Data|Sort doesn't prompt you
(and almost everything else, too).

vanessa h wrote:

I have a workbook with many worksheets in it.
I got a macro written in my earlier post for deleting the rows in it.
Now I want to make some modifications in it. When I run the macro, it
should prompt me for a input box saying "Please select a worksheet".
And after user inputs the worksheet name (excel tab name), the macro
should run on that perticular sheet only.

--
vanessa h
------------------------------------------------------------------------
vanessa h's Profile: http://www.excelforum.com/member.php...o&userid=30731
View this thread: http://www.excelforum.com/showthread...hreadid=505622


--

Dave Peterson