rider: VB-Script und Excel Button

Beitrag lesen

Ok, ich komm schon wieder nicht weiter:

Private Sub CommandButton2_Click()
Dim XYZ As String
Dim objBlatt As Object
Dim strQuellBlatt As String

XYZ = Application.InputBox("Welcher Träger soll umbenannt werden?", "Schreibfehler gemacht?", XYZ)
   If XYZ = "" Then Exit Sub

With Worksheets("Auswertungen").Range("a1:a500")
    Set c = .Find("XYZ", LookIn:=xlValues)
    If Not c Is Nothing Then
        firstAddress = c.Address
        Do
            c.Value = "XYZ"
            Set c = .FindNext(c)
        Loop While Not c Is Nothing And c.Address <> firstAddress
    End If
End With