Questo dovrebbe fare quello che ti serve
Ciaocodice:Private Sub CommandButton1_Click() For Each Casella In Range("a1", Range("a1").End(xlDown)) Posizione_Parentesi_1 = InStr(1, Casella.Value, "(") If Posizione_Parentesi_1 > 0 Then Posizione_Parentesi_2 = InStr(1, Casella.Value, ")") Lunghezza = Posizione_Parentesi_2 - Posizione_Parentesi_1 - 1 Stringa_New = Mid(Casella.Value, Posizione_Parentesi_1 + 1, Lunghezza) Casella.Value = Replace(Casella.Value, "CPUREC", Stringa_New) Else Casella.Value = Stringa_New & " " & Casella.Value End If Next End Sub

Rispondi quotando