LearnMeExcel
Well-known Member
- Joined
- Aug 11, 2009
- Messages
- 746
- Office Version
- 365
- 2021
- Platform
- Windows
Hi
i wrote this code
but it doesn't work
when i change this line in my code it is working
what is the wrong with Split
Thanx in Advanced
i wrote this code
Code:
Sub DelSh()
Dim ws As Worksheet, wb As Workbook
Set wb = ActiveWorkbook
Application.DisplayAlerts = False
For Each ws In Sheets
If ws.Name = Split(wb.Name, ".") Then
ws.Delete
End If
Next ws
Application.DisplayAlerts = True
End Sub
but it doesn't work
when i change this line in my code it is working
Code:
If ws.Name & ".xlsx" = wb.Name Then
Thanx in Advanced