I get an extract from SAP where for each tab there is a sister tab with the same name followed by +. An example is PL1516and PL1516+. The last tab has nothing, and I just want to delete them. I tried this macro, but it does not work.
PL1516
PL1516+
Option Explicit Sub deleteSheets() Dim Sht As Worksheet For Each Sht In ActiveWorkbook.Worksheets If Sht.Name = "*+*" Then Sht.Delete End If Next Sht End Sub
Use the Like method to match characters.
Option Explicit Sub deleteSheets() Dim Sht As Worksheet For Each Sht In ActiveWorkbook.Worksheets If Sht.Name Like "*+*" Then Sht.Delete End If Next Sht End Sub
Try changing this line If Sht.Name = "*+*" Thento If InStr(Sht.Name, "+") > 0 Then. It should work.
If Sht.Name = "*+*" Then
If InStr(Sht.Name, "+") > 0 Then
Source: https://habr.com/ru/post/1651152/More articles:Rescue NameError, but not NoMethodError - ruby | fooobar.comЗначения, прошедшие действительный указатель на строку C-Style - c++Deny input at specific times - cWhy fflush (stdin) does not delete the buffer (stdin) - cКаков наиболее численный метод деления сумм или различий? - floating-pointExtern keyword for defining static data members and member functions, C ++ - c ++Blackheath "Functional reactive programming", 2.6.3 section explanation - functional-programmingFailed to install pyzmail - "Command" python setup.py egg_info "failed with error code 1" - pythonHow do I get webpack to rewrite image sources from a pug? - webpackWhat is the right way to cross asynchronously and save my results with django celery and redis and save mine? - pythonAll Articles