Such Makro läuft nicht...
30.08.2004 07:48:19
Andi
Habe jetzt schon seit einigen Tagen das gleiche Problem:
https://www.herber.de/forum/messages/476154.html
Leider hat mich das nicht weitergebracht. Mit trim läuft gar nichts mehr, d.h. jetzt wird nichts mehr gesucht.
Bei meinem "Suchmakro" funktioniert der Code auch nicht! Es kommt immer die Meldung, dass das Blatt nicht existiert, auch wenn es existiert...
Hier nochmals mein Code:
Private Sub CommandButton1_Click()
'suchen nach Tab.blatt
Application.ScreenUpdating = False
On Error Resume Next
Dim q
Dim wks As Worksheet
Dim strWKS As String
strWKS = TextBox1.Value
For Each wks In Worksheets
If strWKS = "" Then
Application.ScreenUpdating = True
Exit Sub
End If
If InStr(UCase(wks.Name), UCase(strWKS)) > 0 Then
wks.Visible = True
wks.Activate
Exit For
End If
Next wks
Unload Me
q = MsgBox("Blattname existiert nicht. Neues Prüfblattlatt anlegen?", vbYesNo)
If q = vbNo Then Exit Sub
If q = vbYes Then
Call Makro_neues_Blatt_anlegen
End If
Application.ScreenUpdating = True
End Sub
Bitte helft mir.
Gruß Andi