Delete Function:
One way:
Dim rResult As Range
Do
Set rResult = Application.InputBox( _
Prompt:="Select cell to clear: ", _
Title:="Clear cell and delete sheet", _
Type:=8)
If rResult Is Nothing Then Exit Sub 'User cancelled
Loop Until Not Intersect(rResult(1), Range("A2:A100")) Is Nothing
On Error Resume Next
Application.DisplayAlerts = False
Sheets(rResult(1).Text).Delete
Application.DisplayAlerts = True
On Error GoTo 0
rResult(1).ClearContents
In article . com,
"Ardy" wrote:
I am trying to create a macro that will delete a cell content and
related tab by picking the cell. i.e. We have bunch of names in column
A starting at A2 in tab "Roster". Each name in "Roster" has
its own respected Tab. The macro or Code once activated will have the
user to pick the cell that has the name to be deleted, clears the
content, but before clearing will capture the name in a variable that
will be used to find the respected tab and delete the tab as well.
Any help on this is appreciated.
Ardy
|