View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
webels webels is offline
external usenet poster
 
Posts: 44
Default renaming tabs based on a on a worksheet

HI
This is a piece of code written by Dave Peterson, it works perfect for
my needs.

Option Explicit
Sub testme01()
Dim wks As Worksheet
For Each wks In ActiveWorkbook.Worksheets
With wks
On Error Resume Next
..Name = .Range("b4").Text
If Err.Number < 0 Then
MsgBox .Name & " was not renamed"
Err.Clear
End If
On Error GoTo 0
End With
Next wks
End Sub



However what I would like to also do would be to delete a worksheet if
the is no value in cell b4.

Many thanks for any suggestions.

Thanks
Eddie