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

Hi there,

I have created a check box to delete certain sheet (which is called by ref) )
in my mainsheet called "Home". So that when user check the box, it will
delete the selected sheet. This is what I've done so far... Can some one
correct me..???



Const MainSheet = "Home"

/-----------------------------------------------------------------------------
--------------------------------------/
Sub InitializeValues()

With Worksheets(MainSheet) 'check for
all user inputs

ClearResultsSheet_checked = .ClearResultsSheetCheckBox1.Value

End With
End Sub

/-----------------------------------------------------------------------------
------------------------------------/
Sub ClearSheet(ByRef spectype As String)
'just to clear the old Results Sheet before putting any new data
in

Dim strname As String

strname = spectype & " Results"

Worksheets(strname).Activate

'Worksheets(SheetName).Activate
Cells.Select
Selection.Delete
Range("A").Select

End Sub

/-----------------------------------------------------------------------------
--------------------------------/

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200606/1
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete selected sheet


Hello cyzax7,

Try this...

Sub ClearSheet(ByRef spectype As String)
'just to clear the old Results Sheet before putting any new data
in

Dim strname As String

strname = spectype & " Results"

With Worksheets(strname)
UsedRange.ClearContents
Range("A").Select
End With

End Sub

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=551257

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
Delete selected range RW Excel Programming 2 December 12th 05 12:55 PM
how do i make it so that when a sheat is selected either via link or tab, that xlLastCell is selected. the last on the sheet. Daniel Excel Worksheet Functions 1 July 12th 05 01:30 AM
delete every nth row in selected range cwinters Excel Discussion (Misc queries) 1 July 6th 05 08:17 PM
Delete non-selected rows SparePersn Excel Programming 2 December 21st 04 02:57 PM
Delete Selected Rows Ken[_18_] Excel Programming 2 February 5th 04 10:33 PM


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